From 7357a199d2adcf8a4c2bc8e864c426badf9f6886 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Sat, 29 Jun 2024 09:48:18 -0500 Subject: [PATCH 1/3] fixes for VDS TileContainer update Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Atoms/Views/Tilelet.swift | 3 +-- MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Tilelet.swift b/MVMCoreUI/Atomic/Atoms/Views/Tilelet.swift index 8ed4fd55..7d0968df 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Tilelet.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Tilelet.swift @@ -137,8 +137,7 @@ open class Tilelet: VDS.Tilelet, VDSMoleculeViewProtocol{ extension Tilelet: MVMCoreUIViewConstrainingProtocol { - // Investigate later. - //public func horizontalAlignment() -> UIStackView.Alignment { .leading } + public func horizontalAlignment() -> UIStackView.Alignment { .leading } public func isClippable() -> Bool { return false diff --git a/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift b/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift index cf5d382b..561d45b4 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift @@ -44,7 +44,9 @@ open class TileletModel: TileContainerBaseModel, Molec case directionalIcon case textWidth case textPercentage + case aspectRatio } + required public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString @@ -86,8 +88,10 @@ open class TileletModel: TileContainerBaseModel, Molec } else { subTitleColor = .primary } - + try super.init(from: decoder) + //Tilelet default is .none, not ratio1x1 (TileContainer) + aspectRatio = try container.decodeIfPresent(Tilelet.AspectRatio.self, forKey: .aspectRatio) ?? .none } public func eyebrowModel(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> Tilelet.EyebrowModel? { From f3efb91fee0792860241f80e9acc21a595b5dfb6 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 1 Jul 2024 11:12:57 -0500 Subject: [PATCH 2/3] remove horizontalAlignment Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift | 2 -- MVMCoreUI/Atomic/Atoms/Views/Tilelet.swift | 3 --- 2 files changed, 5 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift b/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift index 6296f640..eb5020c1 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift @@ -135,8 +135,6 @@ open class TileContainer: VDS.TileContainer, VDSMoleculeViewProtocol{ } extension TileContainer: MVMCoreUIViewConstrainingProtocol { - public func horizontalAlignment() -> UIStackView.Alignment { .leading } - public func isClippable() -> Bool { return false } diff --git a/MVMCoreUI/Atomic/Atoms/Views/Tilelet.swift b/MVMCoreUI/Atomic/Atoms/Views/Tilelet.swift index 7d0968df..bd2c0c73 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Tilelet.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Tilelet.swift @@ -136,9 +136,6 @@ open class Tilelet: VDS.Tilelet, VDSMoleculeViewProtocol{ } extension Tilelet: MVMCoreUIViewConstrainingProtocol { - - public func horizontalAlignment() -> UIStackView.Alignment { .leading } - public func isClippable() -> Bool { return false } From dee11d77329758178587f1740c44af625a0afaeb Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 1 Jul 2024 11:13:18 -0500 Subject: [PATCH 3/3] aspectRatio set to .none Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift | 4 ++-- MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift b/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift index b8b64f3d..0e7c6032 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/TileContainerModel.swift @@ -67,7 +67,7 @@ open class TileContainerBaseModel, Molec case directionalIcon case textWidth case textPercentage - case aspectRatio } required public init(from decoder: Decoder) throws { @@ -90,8 +89,6 @@ open class TileletModel: TileContainerBaseModel, Molec } try super.init(from: decoder) - //Tilelet default is .none, not ratio1x1 (TileContainer) - aspectRatio = try container.decodeIfPresent(Tilelet.AspectRatio.self, forKey: .aspectRatio) ?? .none } public func eyebrowModel(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> Tilelet.EyebrowModel? {