parent
62afe434f9
commit
10370f3ac6
@ -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
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user