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