formatting
This commit is contained in:
parent
3ec07412c2
commit
b84a6b4ccd
@ -8,16 +8,22 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
@objcMembers open class ListFourColumnDataUsageDivider: TableViewCell {
|
@objcMembers open class ListFourColumnDataUsageDivider: TableViewCell {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Properties
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
// MARK: - MFViewProtocol
|
|
||||||
let label1 = Label.createLabelBoldBodySmall(true)
|
let label1 = Label.createLabelBoldBodySmall(true)
|
||||||
let label2 = Label.createLabelBoldBodySmall(true)
|
let label2 = Label.createLabelBoldBodySmall(true)
|
||||||
let label3 = Label.createLabelBoldBodySmall(true)
|
let label3 = Label.createLabelBoldBodySmall(true)
|
||||||
let label4 = Label.createLabelBoldBodySmall(true)
|
let label4 = Label.createLabelBoldBodySmall(true)
|
||||||
var stack: Stack<StackModel>
|
var stack: Stack<StackModel>
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
stack = Stack<StackModel>.createStack(with: [(view: label1, model: StackItemModel(percent: 19, horizontalAlignment: .leading)),
|
stack = Stack<StackModel>.createStack(with: [(view: label1, model: StackItemModel(percent: 19, horizontalAlignment: .leading)),
|
||||||
(view: label2, model: StackItemModel(percent: 44, horizontalAlignment: .leading)),
|
(view: label2, model: StackItemModel(percent: 44, horizontalAlignment: .leading)),
|
||||||
@ -31,17 +37,25 @@ import Foundation
|
|||||||
fatalError("init(coder:) has not been implemented")
|
fatalError("init(coder:) has not been implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
// MARK: - MFViewProtocol
|
// MARK: - MFViewProtocol
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
open override func setupView() {
|
open override func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
addMolecule(stack)
|
addMolecule(stack)
|
||||||
stack.restack()
|
stack.restack()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
// MARK: - MoleculeViewProtocol
|
// 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)
|
super.set(with: model, delegateObject, additionalData)
|
||||||
|
|
||||||
guard let model = model as? ListFourColumnDataUsageDividerModel else { return }
|
guard let model = model as? ListFourColumnDataUsageDividerModel else { return }
|
||||||
|
|
||||||
label1.set(with: model.label1, delegateObject, additionalData)
|
label1.set(with: model.label1, delegateObject, additionalData)
|
||||||
label2.set(with: model.label2, delegateObject, additionalData)
|
label2.set(with: model.label2, delegateObject, additionalData)
|
||||||
label3.set(with: model.label3, delegateObject, additionalData)
|
label3.set(with: model.label3, delegateObject, additionalData)
|
||||||
@ -52,7 +66,6 @@ import Foundation
|
|||||||
return 121
|
return 121
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - MoleculeViewProtocol
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
label1.styleBoldBodySmall(true)
|
label1.styleBoldBodySmall(true)
|
||||||
|
|||||||
@ -8,13 +8,22 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
public class ListFourColumnDataUsageDividerModel: ListItemModel, MoleculeModelProtocol {
|
public class ListFourColumnDataUsageDividerModel: ListItemModel, MoleculeModelProtocol {
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Properties
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public static var identifier: String = "list4CDiv"
|
public static var identifier: String = "list4CDiv"
|
||||||
public var label1: LabelModel
|
public var label1: LabelModel
|
||||||
public var label2: LabelModel
|
public var label2: LabelModel
|
||||||
public var label3: LabelModel
|
public var label3: LabelModel
|
||||||
public var label4: LabelModel
|
public var label4: LabelModel
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Initializer
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public init(label1: LabelModel, label2: LabelModel, label3: LabelModel, label4: LabelModel) {
|
public init(label1: LabelModel, label2: LabelModel, label3: LabelModel, label4: LabelModel) {
|
||||||
self.label1 = label1
|
self.label1 = label1
|
||||||
self.label2 = label2
|
self.label2 = label2
|
||||||
@ -23,12 +32,15 @@ public class ListFourColumnDataUsageDividerModel: ListItemModel, MoleculeModelPr
|
|||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Defaults to set
|
|
||||||
override public func setDefaults() {
|
override public func setDefaults() {
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
style = "tallDivider"
|
style = "tallDivider"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Keys
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case moleculeName
|
case moleculeName
|
||||||
case label1
|
case label1
|
||||||
@ -37,6 +49,10 @@ public class ListFourColumnDataUsageDividerModel: ListItemModel, MoleculeModelPr
|
|||||||
case label4
|
case label4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - Codec
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
label1 = try typeContainer.decode(LabelModel.self, forKey: .label1)
|
label1 = try typeContainer.decode(LabelModel.self, forKey: .label1)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user