diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnDropdownSelectors.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnDropdownSelectors.swift index 1e3f2fe3..dd907555 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnDropdownSelectors.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnDropdownSelectors.swift @@ -14,8 +14,8 @@ import Foundation // MARK: - Outlets //------------------------------------------------------- - let leftDropDown = ItemDropdownEntryField() - let rightDropDown = ItemDropdownEntryField() + public let leftDropDown = ItemDropdownEntryField() + public let rightDropDown = ItemDropdownEntryField() var stack: Stack //------------------------------------------------------- @@ -25,7 +25,7 @@ import Foundation public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { stack = Stack.createStack(with: [(view: leftDropDown, model: StackItemModel(percent: 50, horizontalAlignment: .fill)), (view: rightDropDown, model: StackItemModel(percent: 50, horizontalAlignment: .fill))], - axis: .horizontal,spacing: 10) + axis: .horizontal, spacing: 9) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -36,24 +36,20 @@ import Foundation //------------------------------------------------------- // MARK: - View Lifecycle //------------------------------------------------------- + open override func setupView() { super.setupView() addMolecule(stack) stack.restack() } - //---------------------------------------------------- - // MARK: - Molecule - //------------------------------------------------------ - override open func reset() { - super.reset() - leftDropDown.reset() - rightDropDown.reset() - } + //---------------------------------------------------- + // MARK: - Molecule + //------------------------------------------------------ open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { super.set(with: model, delegateObject, additionalData) - guard let model = model as? ListTwoColumnDropdownSelectorsModel else { return} + guard let model = model as? ListTwoColumnDropdownSelectorsModel else { return } leftDropDown.set(with:model.leftDropDown, delegateObject, additionalData) rightDropDown.set(with:model.rightDropDown, delegateObject, additionalData) } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnDropdownSelectorsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnDropdownSelectorsModel.swift index 466d75f1..88b8d772 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnDropdownSelectorsModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnDropdownSelectorsModel.swift @@ -28,13 +28,15 @@ public class ListTwoColumnDropdownSelectorsModel: ListItemModel, MoleculeModelPr if bottomPadding == nil { bottomPadding = 0 } + if line == nil { + line = LineModel(type: .none) + } } - public init(leftDropDown : ItemDropdownEntryFieldModel, rightDropDown: ItemDropdownEntryFieldModel){ + public init(leftDropDown: ItemDropdownEntryFieldModel, rightDropDown: ItemDropdownEntryFieldModel) { self.leftDropDown = leftDropDown self.rightDropDown = rightDropDown super.init() - setDefaults() } private enum CodingKeys: String, CodingKey { @@ -53,7 +55,7 @@ public class ListTwoColumnDropdownSelectorsModel: ListItemModel, MoleculeModelPr public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(ListTwoColumnDropdownSelectorsModel.identifier, forKey: .moleculeName) + try container.encode(moleculeName, forKey: .moleculeName) try container.encode(leftDropDown, forKey: .leftDropDown) try container.encode(rightDropDown, forKey: .rightDropDown) }