child molecule fixes
This commit is contained in:
parent
5a08c88e2c
commit
52a872f95d
@ -18,7 +18,7 @@ public class ListLeftVariableIconWithRightCaretBodyTextModel: ListItemModel, Par
|
||||
public var rightLabel: LabelModel
|
||||
|
||||
public var children: [MoleculeModelProtocol] {
|
||||
return [image, headlineBody, rightLabel]
|
||||
[image, headlineBody, rightLabel]
|
||||
}
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
||||
@ -91,3 +91,25 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc
|
||||
try container.encodeModelIfPresent(titleView, forKey: .titleView)
|
||||
}
|
||||
}
|
||||
|
||||
extension NavigationItemModel: ParentMoleculeModelProtocol {
|
||||
public var children: [MoleculeModelProtocol] {
|
||||
var children: [MoleculeModelProtocol] = []
|
||||
if let line = line {
|
||||
children.append(line)
|
||||
}
|
||||
if let titleView = titleView {
|
||||
children.append(titleView)
|
||||
}
|
||||
if let backButton = backButton {
|
||||
children.append(backButton)
|
||||
}
|
||||
if let leftButtons = additionalLeftButtons {
|
||||
children.append(contentsOf: leftButtons)
|
||||
}
|
||||
if let rightButtons = additionalRightButtons {
|
||||
children.append(contentsOf: rightButtons)
|
||||
}
|
||||
return children
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
public var moleculeStack: StackModel
|
||||
|
||||
public override var rootMolecules: [MoleculeModelProtocol] {
|
||||
return [header, moleculeStack, footer].compactMap { $0 }
|
||||
[navigationBar, header, moleculeStack, footer].compactMap { $0 }
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
public var footer: MoleculeModelProtocol?
|
||||
|
||||
public override var rootMolecules: [MoleculeModelProtocol] {
|
||||
return [header, footer].compactMap { $0 }
|
||||
[navigationBar, header, footer].compactMap { $0 }
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user