diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index e02f3542..efe433b4 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -896,9 +896,9 @@ D224798F2316A99F003FCCF9 /* LeftRightViews */ = { isa = PBXGroup; children = ( - D2E2A99723D8D63C000B42E6 /* ActionDetailWithImageModel.swift */, - 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */, 8D24041423E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift */, + 8D24041023E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift */, + D2E2A99723D8D63C000B42E6 /* ActionDetailWithImageModel.swift */, 0A12149F22C11A17007C7030 /* ActionDetailWithImage.swift */, D28A839023CD4FD400DFE4FC /* CornerLabelsModel.swift */, 01509D902327ECE600EF99AA /* CornerLabels.swift */, diff --git a/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableIconWithRightCaret.swift b/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableIconWithRightCaret.swift index 9fd26d4a..62a19d01 100644 --- a/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableIconWithRightCaret.swift +++ b/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableIconWithRightCaret.swift @@ -14,10 +14,11 @@ import UIKit //----------------------------------------------------- // MARK: - Outlets //------------------------------------------------------- - let leftImage = MFLoadImageView() + let leftImage = MFLoadImageView(pinnedEdges: .all) let leftLabel = Label.commonLabelB2(true) let rightLabel = Label.commonLabelB2(true) let stack = Stack(frame: .zero) + //----------------------------------------------------- // MARK: - View Lifecycle //------------------------------------------------------- @@ -38,6 +39,7 @@ import UIKit leftLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 901), for: .horizontal) rightLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 902), for: .horizontal) } + //---------------------------------------------------- // MARK: - Molecule //------------------------------------------------------ @@ -65,4 +67,8 @@ import UIKit stack.model = stackModel stack.restack() } + + public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 90 + } } diff --git a/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableIconWithRightCaretModel.swift b/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableIconWithRightCaretModel.swift index 1ad7afbc..cac928d3 100644 --- a/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableIconWithRightCaretModel.swift +++ b/MVMCoreUI/Molecules/LeftRightViews/ListLeftVariableIconWithRightCaretModel.swift @@ -37,6 +37,7 @@ public class ListLeftVariableIconWithRightCaretModel: ContainerModel, ListItemMo self.leftLabel = leftLabel self.rightLabel = rightLabel super.init() + setDefaults() } private enum CodingKeys: String, CodingKey { @@ -45,6 +46,7 @@ public class ListLeftVariableIconWithRightCaretModel: ContainerModel, ListItemMo case rightLabel case image case action + case backgroundColor } required public init(from decoder: Decoder) throws { @@ -53,6 +55,7 @@ public class ListLeftVariableIconWithRightCaretModel: ContainerModel, ListItemMo rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel) image = try typeContainer.decode(ImageViewModel.self, forKey: .image) action = try typeContainer.decodeModelIfPresent(codingKey: .action, typeCodingKey: ActionCodingKey.actionType) + backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) try super.init(from: decoder) setDefaults() } @@ -60,10 +63,11 @@ public class ListLeftVariableIconWithRightCaretModel: ContainerModel, ListItemMo public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(ListLeftVariableIconWithRightCaretModel.identifier, forKey: .moleculeName) + try container.encode(moleculeName, forKey: .moleculeName) try container.encode(leftLabel, forKey: .leftLabel) try container.encode(rightLabel, forKey: .rightLabel) try container.encode(image, forKey: .image) + try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encodeModelIfPresent(action, forKey: .action) } }