diff --git a/VDS/Components/Label/VDSLabel.swift b/VDS/Components/Label/VDSLabel.swift index 31480ee8..acb6fc58 100644 --- a/VDS/Components/Label/VDSLabel.swift +++ b/VDS/Components/Label/VDSLabel.swift @@ -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) } diff --git a/VDS/Components/Label/VDSLabelModel.swift b/VDS/Components/Label/VDSLabelModel.swift index ca93ae16..1958b84c 100644 --- a/VDS/Components/Label/VDSLabelModel.swift +++ b/VDS/Components/Label/VDSLabelModel.swift @@ -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(){} +}