Minor fixes
This commit is contained in:
parent
d8a5dd336b
commit
cc5536a8d1
@ -995,8 +995,8 @@
|
||||
D22B38EB23F4E0AE00490EF6 /* LeftVariable */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */,
|
||||
522679C023FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinksModel.swift */,
|
||||
522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */,
|
||||
8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */,
|
||||
8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */,
|
||||
);
|
||||
|
||||
@ -9,11 +9,11 @@
|
||||
import Foundation
|
||||
|
||||
@objcMembers public class ListLeftVariableCheckboxAllTextAndLinks: TableViewCell {
|
||||
|
||||
let checkbox = Checkbox(frame: .zero)
|
||||
let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero)
|
||||
let stack = Stack<StackModel>(frame: .zero)
|
||||
public let checkbox = Checkbox(frame: .zero)
|
||||
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero)
|
||||
public let stack = Stack<StackModel>(frame: .zero)
|
||||
|
||||
// MARK: - View Lifecycle
|
||||
open override func updateView(_ size: CGFloat) {
|
||||
super.updateView(size)
|
||||
stack.updateView(size)
|
||||
@ -21,20 +21,18 @@ import Foundation
|
||||
|
||||
override open func setupView() {
|
||||
super.setupView()
|
||||
guard checkbox.superview == nil else {
|
||||
return
|
||||
}
|
||||
stack.translatesAutoresizingMaskIntoConstraints = false
|
||||
stack.stackItems = [StackItem(andContain: checkbox),StackItem(andContain: eyebrowHeadlineBodyLink)]
|
||||
contentView.addSubview(stack)
|
||||
containerHelper.constrainView(stack)
|
||||
}
|
||||
|
||||
// MARK:- ModelMoleculeViewProtocol
|
||||
override open func reset() {
|
||||
super.reset()
|
||||
stack.reset()
|
||||
}
|
||||
|
||||
// MARK:- MVMCoreUIMoleculeViewProtocol
|
||||
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||
super.setWithModel(model, delegateObject, additionalData)
|
||||
guard let model = model as? ListLeftVariableCheckboxAllTextAndLinksModel else { return}
|
||||
@ -42,13 +40,17 @@ import Foundation
|
||||
eyebrowHeadlineBodyLink.setWithModel(model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
|
||||
|
||||
// Create a stack model to use for the internal stack and set the alignment of labels
|
||||
let checkbox = StackItemModel(percent: 10)
|
||||
checkbox.horizontalAlignment = .leading
|
||||
let eyebrowHeadlineBodyLink = StackItemModel(percent: 90)
|
||||
eyebrowHeadlineBodyLink.horizontalAlignment = .fill
|
||||
let checkbox = StackItemModel()
|
||||
checkbox.horizontalAlignment = .fill
|
||||
let eyebrowHeadlineBodyLink = StackItemModel()
|
||||
eyebrowHeadlineBodyLink.horizontalAlignment = .leading
|
||||
let stackModel = StackModel(molecules: [checkbox,eyebrowHeadlineBodyLink])
|
||||
stackModel.axis = .horizontal
|
||||
stack.model = stackModel
|
||||
stack.restack()
|
||||
}
|
||||
|
||||
public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||
return 140
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,12 +9,11 @@
|
||||
import Foundation
|
||||
|
||||
public class ListLeftVariableCheckboxAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
||||
|
||||
public static var identifier: String = "listLVCB"
|
||||
public var checkbox: CheckboxModel
|
||||
var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
|
||||
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
|
||||
|
||||
init(checkbox: CheckboxModel, eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel) {
|
||||
public init(checkbox: CheckboxModel, eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel) {
|
||||
self.checkbox = checkbox
|
||||
self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink
|
||||
super.init()
|
||||
|
||||
@ -21,9 +21,6 @@ import UIKit
|
||||
// MARK: - MFViewProtocol
|
||||
open override func setupView() {
|
||||
super.setupView()
|
||||
guard stack.superview == nil else {
|
||||
return
|
||||
}
|
||||
stack.stackItems = [StackItem(andContain: eyebrow),StackItem(andContain: headline),StackItem(andContain: body),StackItem(andContain: link)]
|
||||
addSubview(stack)
|
||||
NSLayoutConstraint.constraintPinSubview(toSuperview: stack)
|
||||
|
||||
@ -8,10 +8,10 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
struct EyebrowHeadlineBodyLinkModel: MoleculeModelProtocol {
|
||||
static var identifier: String = "eyebrowHeadlineBodyLink"
|
||||
var backgroundColor: Color?
|
||||
var moleculeName: String? = EyebrowHeadlineBodyLinkModel.identifier
|
||||
public struct EyebrowHeadlineBodyLinkModel: MoleculeModelProtocol {
|
||||
public static var identifier: String = "eyebrowHeadlineBodyLink"
|
||||
public var moleculeName: String? = EyebrowHeadlineBodyLinkModel.identifier
|
||||
public var backgroundColor: Color?
|
||||
public var eyebrow: LabelModel?
|
||||
public var headline: LabelModel?
|
||||
public var body: LabelModel?
|
||||
|
||||
Loading…
Reference in New Issue
Block a user