From 9292e6a8d0ac3bbdbbc26c91469a23bb9f34b607 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 25 Apr 2024 09:18:49 -0500 Subject: [PATCH] set the molecule to the moleculeView found Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift b/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift index f74c7885..77f32707 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift @@ -41,10 +41,11 @@ open class TileContainer: VDS.TileContainer, VDSMoleculeViewProtocol{ //-------------------------------------------------- public func viewModelDidUpdate() { - if let moleculeModel = viewModel.molecule{ - if molecule != nil { - molecule?.set(with: moleculeModel, delegateObject, additionalData) + if let moleculeModel = viewModel.molecule { + if let molecule { + molecule.set(with: moleculeModel, delegateObject, additionalData) } else if let moleculeView = ModelRegistry.createMolecule(moleculeModel, delegateObject: delegateObject, additionalData: additionalData) { + molecule = moleculeView addContentView(moleculeView) } }