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) } }