diff --git a/MVMCoreUI/Atomic/Atoms/Views/Line.swift b/MVMCoreUI/Atomic/Atoms/Views/Line.swift index e3195aa2..c527a362 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Line.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Line.swift @@ -9,15 +9,22 @@ import UIKit import VDS -@objcMembers open class Line: VDS.Line, VDSMoleculeViewProtocol { +@objcMembers open class Line: VDS.View, VDSMoleculeViewProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- + open var line = VDS.Line() open var viewModel: LineModel! open var delegateObject: MVMCoreUIDelegateObject? open var additionalData: [AnyHashable : Any]? - + open var orientation: VDS.Line.Orientation = .horizontal { + didSet { + viewModel.orientation = orientation + update(viewModel: viewModel) + } + } + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- @@ -40,6 +47,15 @@ import VDS super.init(coder: coder) viewModel = LineModel(type: .primary) } + + //-------------------------------------------------- + // MARK: - Overrides + //-------------------------------------------------- + open override func setup() { + super.setup() + addSubview(line) + line.pinToSuperView() + } //-------------------------------------------------- // MARK: - Methods @@ -73,8 +89,8 @@ import VDS //-------------------------------------------------- open func viewModelDidUpdate() { surface = viewModel.surface - style = VDS.Line.Style(rawValue: viewModel.type.rawValue) ?? .primary - orientation = viewModel.orientation + line.style = VDS.Line.Style(rawValue: viewModel.type.rawValue) ?? .primary + line.orientation = viewModel.orientation } //--------------------------------------------------