diff --git a/VDS/Components/Checkbox/CheckboxModel.swift b/VDS/Components/Checkbox/CheckboxModel.swift index 3cda1132..3ca18beb 100644 --- a/VDS/Components/Checkbox/CheckboxModel.swift +++ b/VDS/Components/Checkbox/CheckboxModel.swift @@ -10,9 +10,9 @@ import UIKit public protocol CheckboxModel: Modelable, FormFieldable, Errorable, DataTrackable, Accessable, Selectable, BinaryColorable { var labelText: String? { get set } - var labelTextAttributes: [LabelAttributeModel]? { get set } + var labelTextAttributes: [any LabelAttributeModel]? { get set } var childText: String? { get set } - var childTextAttributes: [LabelAttributeModel]? { get set } + var childTextAttributes: [any LabelAttributeModel]? { get set } } extension CheckboxModel { @@ -67,9 +67,9 @@ public struct DefaultCheckboxModel: CheckboxModel { public var id = UUID() public var selected: Bool = false public var labelText: String? - public var labelTextAttributes: [LabelAttributeModel]? + public var labelTextAttributes: [any LabelAttributeModel]? public var childText: String? - public var childTextAttributes: [LabelAttributeModel]? + public var childTextAttributes: [any LabelAttributeModel]? public var hasError: Bool = false public var errorText: String? diff --git a/VDS/Components/Label/Attributes/LabelAttributeAction.swift b/VDS/Components/Label/Attributes/LabelAttributeAction.swift index b9b77e5a..42cf634d 100644 --- a/VDS/Components/Label/Attributes/LabelAttributeAction.swift +++ b/VDS/Components/Label/Attributes/LabelAttributeAction.swift @@ -18,6 +18,7 @@ public struct LabelAttributeActionModel: LabelAttributeActionable { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- + public var id = UUID() public var location: Int public var length: Int public var action = PassthroughSubject() diff --git a/VDS/Components/Label/Attributes/LabelAttributeColor.swift b/VDS/Components/Label/Attributes/LabelAttributeColor.swift index b04a0e5a..d95b570b 100644 --- a/VDS/Components/Label/Attributes/LabelAttributeColor.swift +++ b/VDS/Components/Label/Attributes/LabelAttributeColor.swift @@ -12,6 +12,7 @@ public struct LabelAttributeColor: LabelAttributeModel { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- + public var id = UUID() public var location: Int public var length: Int public var color: UIColor diff --git a/VDS/Components/Label/Attributes/LabelAttributeFont.swift b/VDS/Components/Label/Attributes/LabelAttributeFont.swift index 767f5270..80a65fbc 100644 --- a/VDS/Components/Label/Attributes/LabelAttributeFont.swift +++ b/VDS/Components/Label/Attributes/LabelAttributeFont.swift @@ -12,6 +12,7 @@ public struct LabelAttributeFont: LabelAttributeModel { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- + public var id = UUID() public var location: Int public var length: Int public var style: TypographicalStyle diff --git a/VDS/Components/Label/Attributes/LabelAttributeModel.swift b/VDS/Components/Label/Attributes/LabelAttributeModel.swift index 75e14f69..1de2130e 100644 --- a/VDS/Components/Label/Attributes/LabelAttributeModel.swift +++ b/VDS/Components/Label/Attributes/LabelAttributeModel.swift @@ -8,7 +8,7 @@ import Foundation import UIKit -public protocol LabelAttributeModel { +public protocol LabelAttributeModel: Identifiable where ID == UUID { var location: Int { get set } var length: Int { get set } func setAttribute(on attributedString: NSMutableAttributedString) diff --git a/VDS/Components/Label/Attributes/LabelAttributeStrikeThrough.swift b/VDS/Components/Label/Attributes/LabelAttributeStrikeThrough.swift index 29829af0..1955c81e 100644 --- a/VDS/Components/Label/Attributes/LabelAttributeStrikeThrough.swift +++ b/VDS/Components/Label/Attributes/LabelAttributeStrikeThrough.swift @@ -9,6 +9,7 @@ import Foundation import UIKit public struct LabelAttributeStrikeThrough: LabelAttributeModel { + public var id = UUID() public var location: Int public var length: Int diff --git a/VDS/Components/Label/Attributes/LabelAttributeUnderline.swift b/VDS/Components/Label/Attributes/LabelAttributeUnderline.swift index f7784711..aa24a491 100644 --- a/VDS/Components/Label/Attributes/LabelAttributeUnderline.swift +++ b/VDS/Components/Label/Attributes/LabelAttributeUnderline.swift @@ -9,6 +9,7 @@ import Foundation import UIKit public struct LabelAttributeUnderline: LabelAttributeModel { + public var id = UUID() public var location: Int public var length: Int public var color: UIColor? diff --git a/VDS/Components/Label/Label.swift b/VDS/Components/Label/Label.swift index 7e03acb2..2b9d01a9 100644 --- a/VDS/Components/Label/Label.swift +++ b/VDS/Components/Label/Label.swift @@ -47,7 +47,7 @@ open class LabelBase: UILabel, ModelHandlerable, ViewProt } @Proxy(\.model.attributes) - open var attributes: [LabelAttributeModel]? + open var attributes: [any LabelAttributeModel]? @Proxy(\.model.typograpicalStyle) open var typograpicalStyle: TypographicalStyle diff --git a/VDS/Components/Label/LabelModel.swift b/VDS/Components/Label/LabelModel.swift index 515676da..aa506db3 100644 --- a/VDS/Components/Label/LabelModel.swift +++ b/VDS/Components/Label/LabelModel.swift @@ -10,13 +10,13 @@ import UIKit public protocol LabelModel: Modelable, Labelable { var text: String? { get set } - var attributes: [LabelAttributeModel]? { get set } + var attributes: [any LabelAttributeModel]? { get set } } public struct DefaultLabelModel: LabelModel { public var id = UUID() public var text: String? - public var attributes: [LabelAttributeModel]? + public var attributes: [any LabelAttributeModel]? public var typograpicalStyle: TypographicalStyle = .BodySmall public var textPosition: TextPosition = .left public var surface: Surface = .light diff --git a/VDS/Components/RadioBox/RadioBoxModel.swift b/VDS/Components/RadioBox/RadioBoxModel.swift index cc675d07..097fa91f 100644 --- a/VDS/Components/RadioBox/RadioBoxModel.swift +++ b/VDS/Components/RadioBox/RadioBoxModel.swift @@ -10,11 +10,11 @@ import UIKit public protocol RadioBoxModel: Modelable, FormFieldable, DataTrackable, Accessable, Selectable, BinaryColorable { var text: String { get set } - var textAttributes: [LabelAttributeModel]? { get set } + var textAttributes: [any LabelAttributeModel]? { get set } var subText: String? { get set } - var subTextAttributes: [LabelAttributeModel]? { get set } + var subTextAttributes: [any LabelAttributeModel]? { get set } var subTextRight: String? { get set } - var subTextRightAttributes: [LabelAttributeModel]? { get set } + var subTextRightAttributes: [any LabelAttributeModel]? { get set } var strikethrough: Bool { get set } } @@ -61,11 +61,11 @@ public struct DefaultRadioBoxModel: RadioBoxModel { public var id = UUID() public var selected: Bool = false public var text: String = "Default Text" - public var textAttributes: [LabelAttributeModel]? + public var textAttributes: [any LabelAttributeModel]? public var subText: String? - public var subTextAttributes: [LabelAttributeModel]? + public var subTextAttributes: [any LabelAttributeModel]? public var subTextRight: String? - public var subTextRightAttributes: [LabelAttributeModel]? + public var subTextRightAttributes: [any LabelAttributeModel]? public var selectedAccentColor: UIColor? public var strikethrough: Bool = false diff --git a/VDS/Components/RadioButton/RadioButtonModel.swift b/VDS/Components/RadioButton/RadioButtonModel.swift index 2d5f86e3..e7ff67e3 100644 --- a/VDS/Components/RadioButton/RadioButtonModel.swift +++ b/VDS/Components/RadioButton/RadioButtonModel.swift @@ -10,9 +10,9 @@ import UIKit public protocol RadioButtonModel: Modelable, FormFieldable, Errorable, DataTrackable, Accessable, Selectable, BinaryColorable { var labelText: String? { get set } - var labelTextAttributes: [LabelAttributeModel]? { get set } + var labelTextAttributes: [any LabelAttributeModel]? { get set } var childText: String? { get set } - var childTextAttributes: [LabelAttributeModel]? { get set } + var childTextAttributes: [any LabelAttributeModel]? { get set } } extension RadioButtonModel { @@ -68,9 +68,9 @@ public struct DefaultRadioButtonModel: RadioButtonModel { public var selected: Bool = false public var labelText: String? - public var labelTextAttributes: [LabelAttributeModel]? + public var labelTextAttributes: [any LabelAttributeModel]? public var childText: String? - public var childTextAttributes: [LabelAttributeModel]? + public var childTextAttributes: [any LabelAttributeModel]? public var hasError: Bool = false public var errorText: String?