diff --git a/MVMCoreUI/Atomic/Atoms/Views/ButtonIcon.swift b/MVMCoreUI/Atomic/Atoms/Views/ButtonIcon.swift index 389033cb..89237662 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/ButtonIcon.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/ButtonIcon.swift @@ -27,6 +27,14 @@ open class ButtonIcon: VDS.ButtonIcon, VDSMoleculeViewProtocol { public func viewModelDidUpdate() { surface = viewModel.surface + onClick = { [weak self] control in + guard let self, let viewModel = self.viewModel else { return } + MVMCoreUIActionHandler.performActionUnstructured(with: viewModel.action, + sourceModel: viewModel, + additionalData: self.additionalData, + delegateObject: self.delegateObject) + } + badgeIndicatorModel = viewModel.badgeIndicatorModel kind = viewModel.kind surfaceType = viewModel.surfaceType diff --git a/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift b/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift index 57b8b8f2..e00c2784 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift @@ -51,19 +51,12 @@ open class TileContainer: VDS.TileContainer, VDSMoleculeViewProtocol{ } } + // set backgroundImage if let imageName = viewModel.backgroundImage { loadImage(imageName) } - padding = viewModel.padding - color = viewModel.color - backgroundEffect = viewModel.backgroundEffect - aspectRatio = viewModel.aspectRatio - width = viewModel.width - height = viewModel.height - showBorder = viewModel.showBorder - showDropShadows = viewModel.showDropShadwows - //setup action + //set action if let action = viewModel.action { //add the subscriber onClick = { [weak self] control in @@ -74,6 +67,18 @@ open class TileContainer: VDS.TileContainer, VDSMoleculeViewProtocol{ delegateObject: self.delegateObject) } } + + //set the rest of the properties + surface = viewModel.surface + imageFallbackColor = viewModel.imageFallbackColor + width = viewModel.width + height = viewModel.height + showBorder = viewModel.showBorder + showDropShadow = viewModel.showDropShadow + padding = viewModel.padding + color = viewModel.color + aspectRatio = viewModel.aspectRatio + backgroundEffect = viewModel.backgroundEffect } private func loadImage(_ imageName: String? = nil) { diff --git a/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift b/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift index b6932ef9..895bb027 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift @@ -55,37 +55,44 @@ open class TileContainerBaseModel