moved default models
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
5de60eef0f
commit
831f4baf18
@ -10,15 +10,6 @@ import UIKit
|
||||
import VDSColorTokens
|
||||
import Combine
|
||||
|
||||
open class DefaultLabelModel: VDSLabelModel {
|
||||
public var fontCategory: VDSFontCategory = .body
|
||||
public var fontSize: VDSFontSize = .large
|
||||
public var fontWeight: VDSFontWeight = .regular
|
||||
public var textPosition: VDSTextPosition = .left
|
||||
public var surface: Surface = .light
|
||||
required public init(){}
|
||||
}
|
||||
|
||||
open class VDSLabel: UILabel, Modelable {
|
||||
@Published public var model: VDSLabelModel = DefaultLabelModel()
|
||||
private var cancellable: AnyCancellable?
|
||||
@ -53,7 +44,7 @@ open class VDSLabel: UILabel, Modelable {
|
||||
setup()
|
||||
}
|
||||
|
||||
func setup() {
|
||||
private func setup() {
|
||||
cancellable = $model.debounce(for: .seconds(ModelStateDebounce), scheduler: RunLoop.main).sink { [weak self] viewModel in
|
||||
self?.onStateChange(viewModel: viewModel)
|
||||
}
|
||||
|
||||
@ -10,3 +10,12 @@ import UIKit
|
||||
|
||||
public protocol VDSLabelModel: Labelable, Surfaceable {
|
||||
}
|
||||
|
||||
open class DefaultLabelModel: VDSLabelModel {
|
||||
public var fontCategory: VDSFontCategory = .body
|
||||
public var fontSize: VDSFontSize = .large
|
||||
public var fontWeight: VDSFontWeight = .regular
|
||||
public var textPosition: VDSTextPosition = .left
|
||||
public var surface: Surface = .light
|
||||
required public init(){}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user