fixes for VDS TileContainer update

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-06-29 09:48:18 -05:00
parent eb78d507d6
commit 7357a199d2
2 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -44,7 +44,9 @@ open class TileletModel: TileContainerBaseModel<Tilelet.Padding, Tilelet>, 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<Tilelet.Padding, Tilelet>, 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? {