Revert "Revert "subclass line directly""
This reverts commit 10370f3ac6.
This commit is contained in:
parent
10370f3ac6
commit
b2b33db8a9
@ -9,22 +9,15 @@
|
|||||||
import UIKit
|
import UIKit
|
||||||
import VDS
|
import VDS
|
||||||
|
|
||||||
@objcMembers open class Line: VDS.View, VDSMoleculeViewProtocol {
|
@objcMembers open class Line: VDS.Line, 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
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -47,15 +40,6 @@ import VDS
|
|||||||
super.init(coder: coder)
|
super.init(coder: coder)
|
||||||
viewModel = LineModel(type: .primary)
|
viewModel = LineModel(type: .primary)
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
|
||||||
// MARK: - Overrides
|
|
||||||
//--------------------------------------------------
|
|
||||||
open override func setup() {
|
|
||||||
super.setup()
|
|
||||||
addSubview(line)
|
|
||||||
line.pinToSuperView()
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Methods
|
// MARK: - Methods
|
||||||
@ -89,8 +73,8 @@ import VDS
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
open func viewModelDidUpdate() {
|
open func viewModelDidUpdate() {
|
||||||
surface = viewModel.surface
|
surface = viewModel.surface
|
||||||
line.style = VDS.Line.Style(rawValue: viewModel.type.rawValue) ?? .primary
|
style = VDS.Line.Style(rawValue: viewModel.type.rawValue) ?? .primary
|
||||||
line.orientation = viewModel.orientation
|
orientation = viewModel.orientation
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user