From 047d9b7014a8b9e2b5e2684e7925c8df1047e952 Mon Sep 17 00:00:00 2001 From: vimal Date: Wed, 3 Jan 2024 15:23:29 +0530 Subject: [PATCH] enhancement on the header update based on the molecules --- .../Atomic/Templates/MoleculeListTemplate.swift | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift b/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift index 1af1a85a..fe30288a 100644 --- a/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift @@ -202,7 +202,21 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol } open func newData(for molecule: MoleculeModelProtocol) { - //TODO: expand for header, navigation, etc + + if let headerMolecule = molecule as? MoleculeHeaderModel { + //If complete header replaced then it makes sense to add this + /*createViewForTableHeader() + let width = view.bounds.width + if let topView = topView as? MVMCoreViewProtocol { + topView.updateView(width) + showHeader(width) + }*/ + //Just update is happening only on the existing molecules. ex. changing the title, action etc.. + (topView as? MoleculeViewProtocol)?.set(with: headerMolecule, delegateObject() as? MVMCoreUIDelegateObject, nil) + return + } + + //TODO: expand for navigation, etc guard let moleculesInfo = moleculesInfo else { return } let indicies = moleculesInfo.indices.filter({ index -> Bool in