diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyTextModel.swift index 33e00982..633989d5 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyTextModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyTextModel.swift @@ -18,7 +18,7 @@ public class ListLeftVariableIconWithRightCaretBodyTextModel: ListItemModel, Par public var rightLabel: LabelModel public var children: [MoleculeModelProtocol] { - return [image, headlineBody, rightLabel] + [image, headlineBody, rightLabel] } //----------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift index 5fab61f9..5f3db6be 100644 --- a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift @@ -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 + } +} diff --git a/MVMCoreUI/Atomic/Templates/StackPageTemplateModel.swift b/MVMCoreUI/Atomic/Templates/StackPageTemplateModel.swift index 27769b20..1ed663c2 100644 --- a/MVMCoreUI/Atomic/Templates/StackPageTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/StackPageTemplateModel.swift @@ -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 } } //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Templates/ThreeLayerModelBase.swift b/MVMCoreUI/Atomic/Templates/ThreeLayerModelBase.swift index 6a1bb244..06d813ef 100644 --- a/MVMCoreUI/Atomic/Templates/ThreeLayerModelBase.swift +++ b/MVMCoreUI/Atomic/Templates/ThreeLayerModelBase.swift @@ -18,7 +18,7 @@ public var footer: MoleculeModelProtocol? public override var rootMolecules: [MoleculeModelProtocol] { - return [header, footer].compactMap { $0 } + [navigationBar, header, footer].compactMap { $0 } } //--------------------------------------------------