This commit is contained in:
Kevin G Christiano 2020-05-28 10:55:45 -04:00
parent 20b42ce91c
commit e7b6028321
18 changed files with 336 additions and 62 deletions

View File

@ -7,16 +7,21 @@
//
import Foundation
@objcMembers open class ListOneColumnFullWidthTextDividerSubsection: TableViewCell {
//-----------------------------------------------------
// MARK: - Outlets
//-----------------------------------------------------
public var stack: Stack<StackModel>
public let headline = Label.createLabelBoldBodySmall(true)
public let body = Label.createLabelRegularBodySmall(true)
//--------------------------------------------------
// MARK: - Initializers
//--------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)),
(view: body, model: StackItemModel(spacing: 0, horizontalAlignment: .leading))],
@ -29,17 +34,24 @@ import Foundation
}
//-----------------------------------------------------
// MARK: - View Lifecycle
// MARK: - Lifecycle
//-----------------------------------------------------
override open func setupView() {
super.setupView()
addMolecule(stack)
stack.restack()
}
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
//--------------------------------------------------
// MARK: - MoleculeViewProtocol
//--------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListOneColumnFullWidthTextDividerSubsectionModel else { return }
headline.set(with: model.headline, delegateObject, additionalData)
body.set(with: model.body, delegateObject, additionalData)
}

View File

@ -8,29 +8,49 @@
import Foundation
public class ListOneColumnFullWidthTextDividerSubsectionModel: ListItemModel, MoleculeModelProtocol {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
public static var identifier: String = "list1CTxtDiv3"
public var headline: LabelModel
public var body: LabelModel
//--------------------------------------------------
// MARK: - Initializer
//--------------------------------------------------
public init(headline: LabelModel, body: LabelModel) {
self.headline = headline
self.body = body
super.init()
}
/// Defaults to set
//--------------------------------------------------
// MARK: - Method
//--------------------------------------------------
override public func setDefaults() {
super.setDefaults()
style = "tallDivider"
}
//--------------------------------------------------
// MARK: - Keys
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case moleculeName
case headline
case body
}
//--------------------------------------------------
// MARK: - Codec
//--------------------------------------------------
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
headline = try typeContainer.decode(LabelModel.self, forKey: .headline)

View File

@ -7,16 +7,21 @@
//
import Foundation
@objcMembers open class ListOneColumnTextWithWhitespaceDividerShort: TableViewCell {
//-----------------------------------------------------
// MARK: - Outlets
//-----------------------------------------------------
public var stack: Stack<StackModel>
public let headline = Label.createLabelBoldTitleMedium(true)
public let body = Label.createLabelRegularBodySmall(true)
//--------------------------------------------------
// MARK: - Initializers
//--------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)),
(view: body, model: StackItemModel(spacing: 0, horizontalAlignment: .leading))],
@ -29,17 +34,24 @@ import Foundation
}
//-----------------------------------------------------
// MARK: - View Lifecycle
// MARK: - Lifecycle
//-----------------------------------------------------
override open func setupView() {
super.setupView()
addMolecule(stack)
stack.restack()
}
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
//--------------------------------------------------
// MARK: - MoleculeViewProtocol
//--------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListOneColumnTextWithWhitespaceDividerShortModel else { return }
headline.set(with: model.headline, delegateObject, additionalData)
body.set(with: model.body, delegateObject, additionalData)
}

View File

@ -8,29 +8,49 @@
import Foundation
public class ListOneColumnTextWithWhitespaceDividerShortModel: ListItemModel, MoleculeModelProtocol {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
public static var identifier: String = "list1CTxtDiv1"
public var headline: LabelModel
public var body: LabelModel
//--------------------------------------------------
// MARK: - Initializer
//--------------------------------------------------
public init(headline: LabelModel, body: LabelModel) {
self.headline = headline
self.body = body
super.init()
}
/// Defaults to set
//--------------------------------------------------
// MARK: - Method
//--------------------------------------------------
override public func setDefaults() {
super.setDefaults()
style = "shortDivider"
}
//--------------------------------------------------
// MARK: - Keys
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case moleculeName
case headline
case body
}
//--------------------------------------------------
// MARK: - Codec
//--------------------------------------------------
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
headline = try typeContainer.decode(LabelModel.self, forKey: .headline)

View File

@ -7,16 +7,21 @@
//
import Foundation
@objcMembers open class ListOneColumnTextWithWhitespaceDividerTall: TableViewCell {
//-----------------------------------------------------
// MARK: - Outlets
//-----------------------------------------------------
public var stack: Stack<StackModel>
public let headline = Label.createLabelBoldTitleMedium(true)
public let body = Label.createLabelRegularBodySmall(true)
//--------------------------------------------------
// MARK: - Initializers
//--------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)),
(view: body, model: StackItemModel(spacing: 0, horizontalAlignment: .leading))],
@ -37,9 +42,15 @@ import Foundation
stack.restack()
}
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
//--------------------------------------------------
// MARK: - MoleculeViewProtocol
//--------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListOneColumnTextWithWhitespaceDividerTallModel else { return }
headline.set(with: model.headline, delegateObject, additionalData)
body.set(with: model.body, delegateObject, additionalData)
}

View File

@ -8,29 +8,49 @@
import Foundation
public class ListOneColumnTextWithWhitespaceDividerTallModel: ListItemModel, MoleculeModelProtocol {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
public static var identifier: String = "list1CTxtDiv2"
public var headline: LabelModel
public var body: LabelModel
//--------------------------------------------------
// MARK: - Initializer
//--------------------------------------------------
public init(headline: LabelModel, body: LabelModel) {
self.headline = headline
self.body = body
super.init()
}
/// Defaults to set
//--------------------------------------------------
// MARK: - Method
//--------------------------------------------------
override public func setDefaults() {
super.setDefaults()
style = "tallDivider"
}
//--------------------------------------------------
// MARK: - Keys
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case moleculeName
case headline
case body
}
//--------------------------------------------------
// MARK: - Codec
//--------------------------------------------------
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
headline = try typeContainer.decode(LabelModel.self, forKey: .headline)

View File

@ -7,16 +7,24 @@
//
import Foundation
@objcMembers open class ListThreeColumnBillChangesDivider: TableViewCell {
//-----------------------------------------------------
// MARK: - Outlets
//-----------------------------------------------------
public let leftLabel = Label.createLabelBoldBodySmall(true)
public let centerLabel = Label.createLabelBoldBodySmall(true)
public let rightLabel = Label.createLabelBoldBodySmall(true)
var stack: Stack<StackModel>
//-----------------------------------------------------
// MARK: - Initializers
//-----------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 44, horizontalAlignment: .leading)),
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 44, horizontalAlignment: .leading)),
(view: centerLabel, model: StackItemModel(percent: 33, horizontalAlignment: .leading)),
(view: rightLabel, model: StackItemModel(percent: 23, horizontalAlignment: .leading))],
axis: .horizontal)
@ -27,17 +35,25 @@ import Foundation
fatalError("init(coder:) has not been implemented")
}
//-----------------------------------------------------
// MARK: - MFViewProtocol
//-----------------------------------------------------
open override func setupView() {
super.setupView()
addMolecule(stack)
stack.restack()
}
//-----------------------------------------------------
// MARK: - ModelMoleculeViewProtocol
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
//-----------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListThreeColumnBillChangesDividerModel else { return }
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
centerLabel.set(with: model.centerLabel, delegateObject, additionalData)
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)

View File

@ -7,12 +7,22 @@
//
import Foundation
public class ListThreeColumnBillChangesDividerModel: ListItemModel, MoleculeModelProtocol {
//-----------------------------------------------------
// MARK: - Properties
//-----------------------------------------------------
public static var identifier: String = "list3CBillChgDiv"
public var leftLabel: LabelModel
public var centerLabel: LabelModel
public var rightLabel: LabelModel
//-----------------------------------------------------
// MARK: - Initialzier
//-----------------------------------------------------
public init(leftLabel: LabelModel, centerLabel:LabelModel, rightLabel: LabelModel) {
self.leftLabel = leftLabel
self.centerLabel = centerLabel
@ -20,12 +30,19 @@ public class ListThreeColumnBillChangesDividerModel: ListItemModel, MoleculeMode
super.init()
}
/// Defaults to set
//-----------------------------------------------------
// MARK: - Method
//-----------------------------------------------------
override public func setDefaults() {
super.setDefaults()
style = "tallDivider"
}
//-----------------------------------------------------
// MARK: - Keys
//-----------------------------------------------------
private enum CodingKeys: String, CodingKey {
case moleculeName
case leftLabel
@ -33,6 +50,10 @@ public class ListThreeColumnBillChangesDividerModel: ListItemModel, MoleculeMode
case rightLabel
}
//-----------------------------------------------------
// MARK: - Codec
//-----------------------------------------------------
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)

View File

@ -8,11 +8,12 @@
import Foundation
@objcMembers open class ListThreeColumnDataUsageDivider: TableViewCell {
//-----------------------------------------------------
// MARK: - Outlets
//-------------------------------------------------------
//-----------------------------------------------------
public let leftLabel = Label.createLabelBoldBodySmall(true)
public let centerLabel = Label.createLabelBoldBodySmall(true)
public let rightLabel = Label.createLabelBoldBodySmall(true)
@ -21,6 +22,7 @@ import Foundation
//------------------------------------------------------
// MARK: - Initializers
//------------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 40, horizontalAlignment: .leading)),
(view: centerLabel, model: StackItemModel(percent: 37, horizontalAlignment: .leading)),
@ -33,24 +35,33 @@ import Foundation
fatalError("init(coder:) has not been implemented")
}
//-----------------------------------------------------
// MARK: - Lifecycle
//-----------------------------------------------------
open override func setupView() {
super.setupView()
addMolecule(stack)
stack.restack()
}
// MARK: - ModelMoleculeViewProtocol
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListThreeColumnDataUsageDividerModel else { return }
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
centerLabel.set(with: model.centerLabel, delegateObject, additionalData)
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
}
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
return 121
}
super.setupView()
addMolecule(stack)
stack.restack()
}
//-----------------------------------------------------
// MARK: - ModelMoleculeViewProtocol
//-----------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListThreeColumnDataUsageDividerModel else { return }
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
centerLabel.set(with: model.centerLabel, delegateObject, additionalData)
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
}
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
return 121
}
open override func reset() {
super.reset()

View File

@ -8,12 +8,21 @@
import Foundation
public class ListThreeColumnDataUsageDividerModel: ListItemModel, MoleculeModelProtocol {
//-----------------------------------------------------
// MARK: - Properties
//-----------------------------------------------------
public static var identifier: String = "list3CDataUsgDiv"
public let leftLabel: LabelModel
public let centerLabel: LabelModel
public let rightLabel: LabelModel
//-----------------------------------------------------
// MARK: - Initializer
//-----------------------------------------------------
public init(leftLabel: LabelModel, centerLabel: LabelModel, rightLabel: LabelModel) {
self.leftLabel = leftLabel
self.centerLabel = centerLabel
@ -21,11 +30,19 @@ public class ListThreeColumnDataUsageDividerModel: ListItemModel, MoleculeModelP
super.init()
}
//-----------------------------------------------------
// MARK: - Method
//-----------------------------------------------------
override public func setDefaults() {
super.setDefaults()
style = "tallDivider"
}
//-----------------------------------------------------
// MARK: - Keys
//-----------------------------------------------------
private enum CodingKeys: String, CodingKey {
case moleculeName
case leftLabel
@ -33,7 +50,11 @@ public class ListThreeColumnDataUsageDividerModel: ListItemModel, MoleculeModelP
case rightLabel
}
required init(from decoder: Decoder) throws {
//-----------------------------------------------------
// MARK: - Codec
//-----------------------------------------------------
required init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)
centerLabel = try typeContainer.decode(LabelModel.self, forKey: .centerLabel)

View File

@ -8,16 +8,21 @@
import Foundation
@objcMembers open class ListThreeColumnInternationalDataDivider: TableViewCell {
//-----------------------------------------------------
// MARK: - Outlets
//-----------------------------------------------------
let leftLabel = Label.createLabelBoldBodySmall(true)
let centerLabel = Label.createLabelBoldBodySmall(true)
let rightLabel = Label.createLabelBoldBodySmall(true)
var stack: Stack<StackModel>
//------------------------------------------------------
// MARK: - Initializers
//------------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 30, horizontalAlignment: .leading)),
(view: centerLabel, model: StackItemModel(percent: 50, horizontalAlignment: .leading)),
@ -33,6 +38,7 @@ import Foundation
//-----------------------------------------------------
// MARK: - MFViewProtocol
//-----------------------------------------------------
open override func setupView() {
super.setupView()
addMolecule(stack)
@ -42,9 +48,11 @@ import Foundation
//-----------------------------------------------------
// MARK: - ModelMoleculeViewProtocol
//-----------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListThreeColumnInternationalDataDividerModel else { return }
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
centerLabel.set(with: model.centerLabel, delegateObject, additionalData)
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
@ -54,9 +62,6 @@ import Foundation
return 121
}
//-----------------------------------------------------
// MARK: - MVMCoreUIMoleculeViewProtocol
//-----------------------------------------------------
override open func reset() {
super.reset()
leftLabel.styleBoldBodySmall(true)

View File

@ -8,12 +8,21 @@
import Foundation
public class ListThreeColumnInternationalDataDividerModel: ListItemModel, MoleculeModelProtocol {
//------------------------------------------------------
// MARK: - Properties
//------------------------------------------------------
public static var identifier: String = "list3CIntDataDiv"
public var leftLabel: LabelModel
public var centerLabel: LabelModel
public var rightLabel: LabelModel
//------------------------------------------------------
// MARK: - Initializers
//------------------------------------------------------
public init (leftLabel: LabelModel, centerLabel: LabelModel, rightLabel: LabelModel) {
self.leftLabel = leftLabel
self.centerLabel = centerLabel
@ -21,11 +30,19 @@ public class ListThreeColumnInternationalDataDividerModel: ListItemModel, Molecu
super.init()
}
//------------------------------------------------------
// MARK: - Method
//------------------------------------------------------
override public func setDefaults() {
super.setDefaults()
style = "tallDivider"
}
//------------------------------------------------------
// MARK: - Keys
//------------------------------------------------------
private enum CodingKeys: String, CodingKey {
case moleculeName
case leftLabel
@ -33,6 +50,10 @@ public class ListThreeColumnInternationalDataDividerModel: ListItemModel, Molecu
case rightLabel
}
//------------------------------------------------------
// MARK: - Codec
//------------------------------------------------------
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)

View File

@ -8,14 +8,21 @@
import Foundation
@objcMembers open class ListThreeColumnPlanDataDivider: TableViewCell {
//-----------------------------------------------------
// MARK: - Properties
//-----------------------------------------------------
let leftHeadlineBody = HeadlineBody(frame: .zero)
let centerHeadLineBody = HeadlineBody(frame: .zero)
let rightHeadLineBody = HeadlineBody(frame: .zero)
let leftHeadlineBody = HeadlineBody()
let centerHeadLineBody = HeadlineBody()
let rightHeadLineBody = HeadlineBody()
var stack: Stack<StackModel>
//-----------------------------------------------------
// MARK: - Initializers
//-----------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: leftHeadlineBody, model: StackItemModel(percent: 33, horizontalAlignment: .leading)),
(view: centerHeadLineBody, model: StackItemModel(percent: 34, horizontalAlignment: .center)),
@ -28,17 +35,25 @@ import Foundation
fatalError("init(coder:) has not been implemented")
}
//-----------------------------------------------------
// MARK: - MFViewProtocol
//-----------------------------------------------------
open override func setupView() {
super.setupView()
addMolecule(stack)
stack.restack()
}
//-----------------------------------------------------
// MARK: - MoleculeViewProtocol
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
//-----------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListThreeColumnPlanDataDividerModel else { return }
leftHeadlineBody.set(with: model.leftHeadlineBody, delegateObject, additionalData)
centerHeadLineBody.set(with: model.centerHeadlineBody, delegateObject, additionalData)
rightHeadLineBody.set(with: model.rightHeadlineBody, delegateObject, additionalData)
@ -48,4 +63,3 @@ import Foundation
return 121
}
}

View File

@ -8,12 +8,21 @@
import UIKit
public class ListThreeColumnPlanDataDividerModel: ListItemModel, MoleculeModelProtocol {
//-----------------------------------------------------
// MARK: - Properties
//-----------------------------------------------------
public static var identifier: String = "list3CHBDiv"
public var leftHeadlineBody: HeadlineBodyModel
public var centerHeadlineBody: HeadlineBodyModel
public var rightHeadlineBody: HeadlineBodyModel
//-----------------------------------------------------
// MARK: - Initializer
//-----------------------------------------------------
public init(leftHeadlineBody: HeadlineBodyModel, centerHeadlineBody:HeadlineBodyModel, rightHeadlineBody: HeadlineBodyModel) {
self.leftHeadlineBody = leftHeadlineBody
self.centerHeadlineBody = centerHeadlineBody
@ -21,7 +30,10 @@ public class ListThreeColumnPlanDataDividerModel: ListItemModel, MoleculeModelPr
super.init()
}
/// Defaults to set
//-----------------------------------------------------
// MARK: - Method
//-----------------------------------------------------
override public func setDefaults() {
super.setDefaults()
style = "tallDivider"
@ -30,6 +42,10 @@ public class ListThreeColumnPlanDataDividerModel: ListItemModel, MoleculeModelPr
rightHeadlineBody.style = .itemHeader
}
//-----------------------------------------------------
// MARK: - Keys
//-----------------------------------------------------
private enum CodingKeys: String, CodingKey {
case moleculeName
case leftHeadlineBody
@ -37,6 +53,10 @@ public class ListThreeColumnPlanDataDividerModel: ListItemModel, MoleculeModelPr
case rightHeadlineBody
}
//-----------------------------------------------------
// MARK: - Codec
//-----------------------------------------------------
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
leftHeadlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .leftHeadlineBody)

View File

@ -8,11 +8,12 @@
import Foundation
@objcMembers open class ListThreeColumnSpeedTestDivider: TableViewCell {
//-------------------------------------------------------
// MARK: - Outlets
//-------------------------------------------------------
let leftLabel = Label.createLabelBoldBodySmall(true)
let centerLabel = Label.createLabelBoldBodySmall(true)
let rightLabel = Label.createLabelBoldBodySmall(true)
@ -21,6 +22,7 @@ import Foundation
//-------------------------------------------------------
// MARK: - Initializers
//-------------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 37, horizontalAlignment: .leading)), (view: centerLabel, model: StackItemModel(percent: 33, horizontalAlignment: .leading)), (view: rightLabel, model: StackItemModel(percent: 30, horizontalAlignment: .leading))], axis: .horizontal)
super.init(style: style, reuseIdentifier: reuseIdentifier)
@ -33,16 +35,18 @@ import Foundation
//-------------------------------------------------------
// MARK: - View Lifecycle
//-------------------------------------------------------
open override func setupView() {
super.setupView()
addMolecule(stack)
stack.restack()
}
//------------------------------------------------------
// MARK: - Molecule
//------------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
// MARK: - MoleculeViewProtocol
//------------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListThreeColumnSpeedTestDividerModel else { return }
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)

View File

@ -8,12 +8,21 @@
import Foundation
public class ListThreeColumnSpeedTestDividerModel: ListItemModel, MoleculeModelProtocol {
//-----------------------------------------------------
// MARK: - Properties
//-----------------------------------------------------
public static var identifier: String = "list3CSpdTstDiv"
public var leftLabel: LabelModel
public var centerLabel: LabelModel
public var rightLabel: LabelModel
//-----------------------------------------------------
// MARK: - Initializer
//-----------------------------------------------------
public init(leftLabel: LabelModel, centerLabel: LabelModel, rightLabel: LabelModel) {
self.leftLabel = leftLabel
self.centerLabel = centerLabel
@ -21,12 +30,19 @@ public class ListThreeColumnSpeedTestDividerModel: ListItemModel, MoleculeModelP
super.init()
}
/// Defaults to set
//-----------------------------------------------------
// MARK: - Method
//-----------------------------------------------------
override public func setDefaults() {
super.setDefaults()
style = "tallDivider"
}
//-----------------------------------------------------
// MARK: - Keys
//-----------------------------------------------------
private enum CodingKeys: String, CodingKey {
case moleculeName
case leftLabel
@ -34,6 +50,10 @@ public class ListThreeColumnSpeedTestDividerModel: ListItemModel, MoleculeModelP
case rightLabel
}
//-----------------------------------------------------
// MARK: - Codec
//-----------------------------------------------------
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)

View File

@ -8,18 +8,20 @@
import Foundation
@objcMembers open class ListTwoColumnSubsectionDivider: TableViewCell {
//--------------------------------------------------
//--------------------------------------------------
// MARK: - Outlets
//--------------------------------------------------
let leftLabel = Label.createLabelBoldBodySmall(true)
let rightLabel = Label.createLabelBoldBodySmall(true)
var stack: Stack<StackModel>
//-------------------------------------------------------
//--------------------------------------------------
// MARK: - Initializers
//-------------------------------------------------------
//--------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 75, horizontalAlignment: .leading)),
(view: rightLabel, model: StackItemModel(percent: 25, horizontalAlignment: .leading))],
@ -31,21 +33,25 @@ import Foundation
fatalError("init(coder:) has not been implemented")
}
//-------------------------------------------------------
// MARK: - View Lifecycle
//-------------------------------------------------------
//--------------------------------------------------
// MARK: - Lifecycle
//--------------------------------------------------
open override func setupView() {
super.setupView()
addMolecule(stack)
stack.restack()
}
//----------------------------------------------------
// MARK: - Molecule
//------------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
//--------------------------------------------------
// MARK: - MoleculeViewProtocol
//--------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListTwoColumnSubsectionDividerModel else { return }
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
}

View File

@ -8,29 +8,49 @@
import Foundation
public class ListTwoColumnSubsectionDividerModel: ListItemModel, MoleculeModelProtocol {
//------------------------------------------------------
// MARK: - Properties
//------------------------------------------------------
public static var identifier: String = "list2CSbscDiv"
public var leftLabel: LabelModel
public var rightLabel: LabelModel
//------------------------------------------------------
// MARK: - Initializer
//------------------------------------------------------
public init(leftLabel: LabelModel, rightLabel: LabelModel) {
self.leftLabel = leftLabel
self.rightLabel = rightLabel
super.init()
}
/// Defaults to set
//------------------------------------------------------
// MARK: - Method
//------------------------------------------------------
override public func setDefaults() {
super.setDefaults()
style = "tallDivider"
}
//------------------------------------------------------
// MARK: - Keys
//------------------------------------------------------
private enum CodingKeys: String, CodingKey {
case moleculeName
case leftLabel
case rightLabel
}
//------------------------------------------------------
// MARK: - Codec
//------------------------------------------------------
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)