Revert "subclass line directly"

This reverts commit 5d9944b5ea.
This commit is contained in:
Matt Bruce 2023-09-20 14:35:46 -05:00
parent 62afe434f9
commit 10370f3ac6

View File

@ -9,14 +9,21 @@
import UIKit import UIKit
import VDS import VDS
@objcMembers open class Line: VDS.Line, VDSMoleculeViewProtocol { @objcMembers open class Line: VDS.View, VDSMoleculeViewProtocol {
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Properties // MARK: - Properties
//-------------------------------------------------- //--------------------------------------------------
open var line = VDS.Line()
open var viewModel: LineModel! open var viewModel: LineModel!
open var delegateObject: MVMCoreUIDelegateObject? open var delegateObject: MVMCoreUIDelegateObject?
open var additionalData: [AnyHashable : Any]? open var additionalData: [AnyHashable : Any]?
open var orientation: VDS.Line.Orientation = .horizontal {
didSet {
viewModel.orientation = orientation
update(viewModel: viewModel)
}
}
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Initializer // MARK: - Initializer
@ -41,6 +48,15 @@ import VDS
viewModel = LineModel(type: .primary) viewModel = LineModel(type: .primary)
} }
//--------------------------------------------------
// MARK: - Overrides
//--------------------------------------------------
open override func setup() {
super.setup()
addSubview(line)
line.pinToSuperView()
}
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Methods // MARK: - Methods
//-------------------------------------------------- //--------------------------------------------------
@ -73,8 +89,8 @@ import VDS
//-------------------------------------------------- //--------------------------------------------------
open func viewModelDidUpdate() { open func viewModelDidUpdate() {
surface = viewModel.surface surface = viewModel.surface
style = VDS.Line.Style(rawValue: viewModel.type.rawValue) ?? .primary line.style = VDS.Line.Style(rawValue: viewModel.type.rawValue) ?? .primary
orientation = viewModel.orientation line.orientation = viewModel.orientation
} }
//-------------------------------------------------- //--------------------------------------------------