update others
This commit is contained in:
parent
be0c9b8742
commit
4b23a63823
@ -40,24 +40,18 @@ import Foundation
|
|||||||
override open func setupView() {
|
override open func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
addMolecule(stack)
|
addMolecule(stack)
|
||||||
|
stack.restack()
|
||||||
}
|
}
|
||||||
|
|
||||||
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? ListOneColumnFullWidthTextAllTextAndLinksModel else { return }
|
guard let model = model as? ListOneColumnFullWidthTextAllTextAndLinksModel else { return }
|
||||||
eyebrow.setOptional(with: model.eyebrow, delegateObject, additionalData)
|
stack.updateContainedMolecules(with: [model.eyebrow,
|
||||||
headline.setOptional(with: model.headline, delegateObject, additionalData)
|
model.headline,
|
||||||
subHeadline.setOptional(with: model.subHeadline, delegateObject, additionalData)
|
model.subHeadline,
|
||||||
body.setOptional(with: model.body, delegateObject, additionalData)
|
model.body,
|
||||||
link.setOptional(with: model.link, delegateObject, additionalData)
|
model.link],
|
||||||
|
delegateObject, additionalData)
|
||||||
// Hide labels if neeeded.
|
|
||||||
stack.stackModel?.molecules[0].gone = !eyebrow.hasText
|
|
||||||
stack.stackModel?.molecules[1].gone = !headline.hasText
|
|
||||||
stack.stackModel?.molecules[2].gone = !subHeadline.hasText
|
|
||||||
stack.stackModel?.molecules[3].gone = !body.hasText
|
|
||||||
stack.stackModel?.molecules[4].gone = (link.titleLabel?.text?.count ?? 0) == 0
|
|
||||||
stack.restack()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
|
|||||||
@ -33,6 +33,7 @@ import UIKit
|
|||||||
stack.stackModel?.spacing = 0
|
stack.stackModel?.spacing = 0
|
||||||
addSubview(stack)
|
addSubview(stack)
|
||||||
NSLayoutConstraint.constraintPinSubview(toSuperview: stack)
|
NSLayoutConstraint.constraintPinSubview(toSuperview: stack)
|
||||||
|
stack.restack()
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func updateView(_ size: CGFloat) {
|
open override func updateView(_ size: CGFloat) {
|
||||||
@ -58,18 +59,11 @@ import UIKit
|
|||||||
|
|
||||||
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)
|
||||||
|
stack.updateContainedMolecules(with: [castModel?.eyebrow,
|
||||||
eyebrow.setOptional(with: castModel?.eyebrow, delegateObject, additionalData)
|
castModel?.headline,
|
||||||
headline.setOptional(with: castModel?.headline, delegateObject, additionalData)
|
castModel?.body,
|
||||||
body.setOptional(with: castModel?.body, delegateObject, additionalData)
|
castModel?.link],
|
||||||
link.setOptional(with: castModel?.link, delegateObject, additionalData)
|
delegateObject, additionalData)
|
||||||
|
|
||||||
// Hide labels if neeeded.
|
|
||||||
stack.stackModel?.molecules[0].gone = !eyebrow.hasText
|
|
||||||
stack.stackModel?.molecules[1].gone = !headline.hasText
|
|
||||||
stack.stackModel?.molecules[2].gone = !body.hasText
|
|
||||||
stack.stackModel?.molecules[3].gone = (link.titleLabel?.text?.count ?? 0) == 0
|
|
||||||
stack.restack()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user