From 20622bef41bf7ebb2b4098d3d0f3387e6f6bc5bb Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 4 Aug 2022 15:41:32 -0500 Subject: [PATCH] added properties to label Signed-off-by: Matt Bruce --- VDS/Components/Label/Label.swift | 33 +++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/VDS/Components/Label/Label.swift b/VDS/Components/Label/Label.swift index 5c93cfdb..d85c0dd2 100644 --- a/VDS/Components/Label/Label.swift +++ b/VDS/Components/Label/Label.swift @@ -23,21 +23,36 @@ open class LabelBase: UILabel, ModelHandlerabl //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- + @Proxy(\.model.attributes) + open var attributes: [LabelAttributeModel]? + + @Proxy(\.model.fontCategory) + open var fontCategory: FontCategory + @Proxy(\.model.fontSize) - public var fontSize: FontSize - - @Proxy(\.model.textPosition) - public var textPosition: TextPosition + open var fontSize: FontSize @Proxy(\.model.fontWeight) - public var fontWeight: FontWeight - - @Proxy(\.model.fontCategory) - public var fontCategory: FontCategory + open var fontWeight: FontWeight + + @Proxy(\.model.textPosition) + open var textPosition: TextPosition @Proxy(\.model.surface) - public var surface: Surface + open var surface: Surface + + @Proxy(\.model.disabled) + open var disabled: Bool + //can't use @Proxy here + override open var text: String? { + didSet { + if model.text != oldValue { + model.text = text + } + } + } + //-------------------------------------------------- // MARK: - Initializers //--------------------------------------------------