diff --git a/VDS/Classes/ColorConfiguration.swift b/VDS/Classes/ColorConfiguration.swift index a1474610..a7cf2673 100644 --- a/VDS/Classes/ColorConfiguration.swift +++ b/VDS/Classes/ColorConfiguration.swift @@ -26,8 +26,8 @@ public typealias ObjectColorable = Colorable & Initable & ObjectWithable /// You can pass in a Surfaceable object and this will return the corresponding Color based on the object's surface property. open class SurfaceColorConfiguration: ObjectColorable { public typealias ObjectType = Surfaceable - public var lightColor: UIColor = .clear - public var darkColor: UIColor = .clear + open var lightColor: UIColor = .clear + open var darkColor: UIColor = .clear required public init(){} diff --git a/VDS/Classes/Control.swift b/VDS/Classes/Control.swift index 4f0f39bc..00f13c57 100644 --- a/VDS/Classes/Control.swift +++ b/VDS/Classes/Control.swift @@ -17,9 +17,9 @@ open class Control: UIControl, Handlerable, ViewProtocol, Resettable, UserInfoab // MARK: - Combine Properties //-------------------------------------------------- /// Set of Subscribers for any Publishers for this Control. - public var subscribers = Set() + open var subscribers = Set() - public var onClickSubscriber: AnyCancellable? { + open var onClickSubscriber: AnyCancellable? { willSet { if let onClickSubscriber { onClickSubscriber.cancel() @@ -40,6 +40,7 @@ open class Control: UIControl, Handlerable, ViewProtocol, Resettable, UserInfoab /// Current Surface and this is used to pass down to child objects that implement Surfacable open var surface: Surface = .light { didSet { setNeedsUpdate() } } + /// Whether this object is disabled or not open var disabled: Bool { get { !isEnabled } set { @@ -52,7 +53,7 @@ open class Control: UIControl, Handlerable, ViewProtocol, Resettable, UserInfoab /// Override for isSelected to handle setNeedsUpdate() on changes. open override var isSelected: Bool { didSet { setNeedsUpdate() } } - public var touchUpInsideCount: Int = 0 + open var touchUpInsideCount: Int = 0 var isHighlightAnimating = false diff --git a/VDS/Classes/SelectorBase.swift b/VDS/Classes/SelectorBase.swift index 326c76bc..cb520876 100644 --- a/VDS/Classes/SelectorBase.swift +++ b/VDS/Classes/SelectorBase.swift @@ -20,7 +20,7 @@ public protocol SelectorControlable: Control, Changeable { open class SelectorBase: Control, SelectorControlable { - public var onChangeSubscriber: AnyCancellable? { + open var onChangeSubscriber: AnyCancellable? { willSet { if let onChangeSubscriber { onChangeSubscriber.cancel() diff --git a/VDS/Classes/SelectorGroupHandlerBase.swift b/VDS/Classes/SelectorGroupHandlerBase.swift index 1418db50..868276ba 100644 --- a/VDS/Classes/SelectorGroupHandlerBase.swift +++ b/VDS/Classes/SelectorGroupHandlerBase.swift @@ -17,10 +17,10 @@ open class SelectorGroupHandlerBase: Control, Changeable { //-------------------------------------------------- /// Array of the HandlerType registered. - public var selectorViews: [HandlerType] = [] + open var selectorViews: [HandlerType] = [] /// The primary subscriber for onChange or the UIControl valueChanged event. - public var onChangeSubscriber: AnyCancellable? { + open var onChangeSubscriber: AnyCancellable? { willSet { if let onChangeSubscriber { onChangeSubscriber.cancel() @@ -28,8 +28,8 @@ open class SelectorGroupHandlerBase: Control, Changeable { } } - /// Override to update the child SelectorViews disabled property for this group. - override public var disabled: Bool { + /// Whether this object is disabled or not + override open var disabled: Bool { didSet { selectorViews.forEach { handler in handler.disabled = disabled @@ -38,7 +38,7 @@ open class SelectorGroupHandlerBase: Control, Changeable { } /// Current Surface and this is used to pass down to child objects that implement Surfacable. - override public var surface: Surface { + override open var surface: Surface { didSet { selectorViews.forEach { handler in handler.surface = surface @@ -57,7 +57,7 @@ open class SelectorGroupHandlerBase: Control, Changeable { } /// Helper method to execute the valueChanged event. - public func valueChanged() { + open func valueChanged() { DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(100)) { [weak self] in self?.sendActions(for: .valueChanged) } diff --git a/VDS/Classes/View.swift b/VDS/Classes/View.swift index ea470798..9566b79a 100644 --- a/VDS/Classes/View.swift +++ b/VDS/Classes/View.swift @@ -18,7 +18,7 @@ open class View: UIView, Handlerable, ViewProtocol, Resettable, UserInfoable { // MARK: - Combine Properties //-------------------------------------------------- /// Set of Subscribers for any Publishers for this Control. - public var subscribers = Set() + open var subscribers = Set() //-------------------------------------------------- // MARK: - Properties diff --git a/VDS/Components/Buttons/Button/Button.swift b/VDS/Components/Buttons/Button/Button.swift index 15c4a0ba..42b3150d 100644 --- a/VDS/Components/Buttons/Button/Button.swift +++ b/VDS/Components/Buttons/Button/Button.swift @@ -149,6 +149,7 @@ open class Button: ButtonBase, Useable { return CGSize(width: width > size.minimumWidth ? width : size.minimumWidth, height: size.height) } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() let bgColor = backgroundColorConfiguration.getColor(self) diff --git a/VDS/Components/Buttons/Button/ButtonBase.swift b/VDS/Components/Buttons/Button/ButtonBase.swift index d3b7c0d7..6672a320 100644 --- a/VDS/Components/Buttons/Button/ButtonBase.swift +++ b/VDS/Components/Buttons/Button/ButtonBase.swift @@ -29,9 +29,9 @@ open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettab // MARK: - Combine Properties //-------------------------------------------------- /// Set of Subscribers for any Publishers for this Control. - public var subscribers = Set() + open var subscribers = Set() - public var onClickSubscriber: AnyCancellable? { + open var onClickSubscriber: AnyCancellable? { willSet { if let onClickSubscriber { onClickSubscriber.cancel() @@ -63,7 +63,7 @@ open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettab open var userInfo = [String: Primitive]() - public var touchUpInsideCount: Int = 0 + open var touchUpInsideCount: Int = 0 internal var isHighlightAnimating = false @@ -160,6 +160,7 @@ open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettab return CGSize(width: adjustedWidth, height: adjustedHeight) } + /// Function used to make changes to the View based off a change events or from local properties. open func updateView() { updateLabel() updateAccessibility() diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift index 790f272f..99aef7f5 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift @@ -29,7 +29,7 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega open var rowQuantityTablet: Int = 0 { didSet { setNeedsUpdate() } } - public var rowQuantity: Int { UIDevice.isIPad ? rowQuantityTablet : rowQuantityPhone } + open var rowQuantity: Int { UIDevice.isIPad ? rowQuantityTablet : rowQuantityPhone } //If provided, aligns TextLink/TextLinkCaret alignment when rowQuantity is set one. open var buttonPosition: ButtonPosition = .center { didSet { setNeedsUpdate() }} @@ -93,7 +93,8 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega //-------------------------------------------------- // MARK: - Overrides //-------------------------------------------------- - override public var disabled: Bool { + /// Whether this object is disabled or not + override open var disabled: Bool { didSet { buttons.forEach { button in var b = button @@ -103,7 +104,7 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega } /// Current Surface and this is used to pass down to child objects that implement Surfacable - override public var surface: Surface { + override open var surface: Surface { didSet { buttons.forEach { button in var b = button @@ -138,6 +139,7 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega //-------------------------------------------------- // MARK: - Overrides //-------------------------------------------------- + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() positionLayout.position = buttonPosition diff --git a/VDS/Components/Buttons/TextLink/TextLink.swift b/VDS/Components/Buttons/TextLink/TextLink.swift index af844530..ca7aac1d 100644 --- a/VDS/Components/Buttons/TextLink/TextLink.swift +++ b/VDS/Components/Buttons/TextLink/TextLink.swift @@ -107,6 +107,7 @@ open class TextLink: ButtonBase { return titleLabel?.intrinsicContentSize ?? super.intrinsicContentSize } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { //need to set the properties so the super class //can render out the label correctly diff --git a/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift b/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift index 22cffb36..a41ebfb0 100644 --- a/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift +++ b/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift @@ -94,6 +94,7 @@ open class TextLinkCaret: ButtonBase { return titleLabel?.intrinsicContentSize ?? super.intrinsicContentSize } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { imageAttribute = CaretLabelAttribute(tintColor: textColor, position: iconPosition) super.updateView() diff --git a/VDS/Components/Checkbox/CheckboxGroup.swift b/VDS/Components/Checkbox/CheckboxGroup.swift index 8eb7f5fc..763a18ab 100644 --- a/VDS/Components/Checkbox/CheckboxGroup.swift +++ b/VDS/Components/Checkbox/CheckboxGroup.swift @@ -14,13 +14,13 @@ open class CheckboxGroup: SelectorGroupHandlerBase { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- - public var selectedHandlers: [CheckboxItem]? { + open var selectedHandlers: [CheckboxItem]? { let selected = selectorViews.filter{ $0.isSelected == true } guard selected.count > 0 else { return nil } return selected } - public override var selectorViews: [CheckboxItem] { + open override var selectorViews: [CheckboxItem] { willSet { mainStackView.arrangedSubviews.forEach { $0.removeFromSuperview() } } @@ -35,7 +35,7 @@ open class CheckboxGroup: SelectorGroupHandlerBase { } } - public var selectorModels: [CheckboxModel]? { + open var selectorModels: [CheckboxModel]? { didSet { if let selectorModels { selectorViews = selectorModels.enumerated().map { index, model in @@ -61,7 +61,7 @@ open class CheckboxGroup: SelectorGroupHandlerBase { } private var _showError: Bool = false - public var showError: Bool { + open var showError: Bool { get { _showError } set { var newShowError = newValue @@ -112,6 +112,7 @@ open class CheckboxGroup: SelectorGroupHandlerBase { extension CheckboxGroup { public struct CheckboxModel : Surfaceable, Disabling, Initable, FormFieldable, Errorable { + /// Whether this object is disabled or not public var disabled: Bool /// Current Surface and this is used to pass down to child objects that implement Surfacable public var surface: Surface diff --git a/VDS/Components/Checkbox/CheckboxItem.swift b/VDS/Components/Checkbox/CheckboxItem.swift index 675aa7cc..994eca5e 100644 --- a/VDS/Components/Checkbox/CheckboxItem.swift +++ b/VDS/Components/Checkbox/CheckboxItem.swift @@ -44,6 +44,7 @@ open class CheckboxItem: SelectorItemBase { sendActions(for: .valueChanged) } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { selectorView.isAnimated = isAnimated super.updateView() diff --git a/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift b/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift index baee9258..00efaca1 100644 --- a/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift +++ b/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift @@ -268,6 +268,7 @@ open class ButtonIcon: Control { setNeedsUpdate() } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() diff --git a/VDS/Components/Icon/Icon.swift b/VDS/Components/Icon/Icon.swift index 9e884875..0c496793 100644 --- a/VDS/Components/Icon/Icon.swift +++ b/VDS/Components/Icon/Icon.swift @@ -69,6 +69,7 @@ open class Icon: View { imageView.image = nil } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() //get the color for the image diff --git a/VDS/Components/Label/Label.swift b/VDS/Components/Label/Label.swift index 13d25d42..1701311f 100644 --- a/VDS/Components/Label/Label.swift +++ b/VDS/Components/Label/Label.swift @@ -17,7 +17,7 @@ open class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable { // MARK: - Combine Properties //-------------------------------------------------- /// Set of Subscribers for any Publishers for this Control. - public var subscribers = Set() + open var subscribers = Set() //-------------------------------------------------- // MARK: - Properties @@ -66,7 +66,7 @@ open class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable { //-------------------------------------------------- // MARK: - Configuration Properties //-------------------------------------------------- - public var textColorConfiguration: AnyColorable = ViewColorConfiguration().with { + open var textColorConfiguration: AnyColorable = ViewColorConfiguration().with { $0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true) $0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false) }.eraseToAnyColorable(){ didSet { setNeedsUpdate() }} @@ -139,7 +139,8 @@ open class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable { //-------------------------------------------------- // MARK: - Overrides - //-------------------------------------------------- + //-------------------------------------------------- + /// Function used to make changes to the View based off a change events or from local properties. open func updateView() { if !useAttributedText { if let text = text { diff --git a/VDS/Components/Line/Line.swift b/VDS/Components/Line/Line.swift index 14ceacc8..070b3768 100644 --- a/VDS/Components/Line/Line.swift +++ b/VDS/Components/Line/Line.swift @@ -31,7 +31,7 @@ open class Line: View { //-------------------------------------------------- // MARK: - Configuration //-------------------------------------------------- - public var lineViewColorConfiguration: AnyColorable = { + open var lineViewColorConfiguration: AnyColorable = { let config = KeyedColorConfiguration(keyPath: \.style) config.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forKey: .primary) config.setSurfaceColors(VDSColor.elementsLowcontrastOnlight, VDSColor.elementsLowcontrastOndark, forKey: .secondary) @@ -56,6 +56,7 @@ open class Line: View { style = .primary } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { lineView.backgroundColor = lineViewColorConfiguration.getColor(self) } diff --git a/VDS/Components/Loader/Loader.swift b/VDS/Components/Loader/Loader.swift index 582eaf2b..9c67b6e2 100644 --- a/VDS/Components/Loader/Loader.swift +++ b/VDS/Components/Loader/Loader.swift @@ -24,10 +24,10 @@ open class Loader: View { // MARK: - Public Properties //-------------------------------------------------- /// Loader will be active if 'active' prop is passed. - public var isActive: Bool = true { didSet { setNeedsUpdate() } } + open var isActive: Bool = true { didSet { setNeedsUpdate() } } /// The Int used to determine the height and width of the Loader - public var size: Int = 40 { didSet { setNeedsUpdate() } } + open var size: Int = 40 { didSet { setNeedsUpdate() } } //-------------------------------------------------- // MARK: - Lifecycle @@ -46,6 +46,7 @@ open class Loader: View { ]) } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() icon.color = iconColorConfiguration.getColor(self) diff --git a/VDS/Components/Loader/LoaderViewController.swift b/VDS/Components/Loader/LoaderViewController.swift index 2b0fb944..d64e7a74 100644 --- a/VDS/Components/Loader/LoaderViewController.swift +++ b/VDS/Components/Loader/LoaderViewController.swift @@ -43,7 +43,7 @@ open class LoaderViewController: UIViewController, Surfaceable { updateView() } - /// Update this view based off of property chang + /// Function used to make changes to the View based off a change events or from local properties. open func updateView() { view.backgroundColor = backgroundColorConfiguration.getColor(self).withAlphaComponent(0.8) if let size { diff --git a/VDS/Components/Notification/Notification.swift b/VDS/Components/Notification/Notification.swift index 25308654..9d6e0e34 100644 --- a/VDS/Components/Notification/Notification.swift +++ b/VDS/Components/Notification/Notification.swift @@ -264,6 +264,7 @@ open class Notification: View { setNeedsUpdate() } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { backgroundColor = backgroundColorConfiguration.getColor(self) updateIcons() diff --git a/VDS/Components/RadioBox/RadioBoxGroup.swift b/VDS/Components/RadioBox/RadioBoxGroup.swift index 84065697..209a5769 100644 --- a/VDS/Components/RadioBox/RadioBoxGroup.swift +++ b/VDS/Components/RadioBox/RadioBoxGroup.swift @@ -30,7 +30,7 @@ open class RadioBoxGroup: SelectorGroupSelectedHandlerBase { } } - public var selectorModels: [RadioBoxModel]? { + open var selectorModels: [RadioBoxModel]? { didSet { if let selectorModels { selectorViews = selectorModels.enumerated().map { index, model in @@ -107,6 +107,7 @@ open class RadioBoxGroup: SelectorGroupSelectedHandlerBase { extension RadioBoxGroup { public struct RadioBoxModel: Surfaceable, Initable, Disabling, FormFieldable { + /// Whether this object is disabled or not public var disabled: Bool /// Current Surface and this is used to pass down to child objects that implement Surfacable public var surface: Surface diff --git a/VDS/Components/RadioBox/RadioBoxItem.swift b/VDS/Components/RadioBox/RadioBoxItem.swift index 6c0d8720..d7c9d1bd 100644 --- a/VDS/Components/RadioBox/RadioBoxItem.swift +++ b/VDS/Components/RadioBox/RadioBoxItem.swift @@ -56,7 +56,7 @@ open class RadioBoxItem: Control, Changeable { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- - public var onChangeSubscriber: AnyCancellable? { + open var onChangeSubscriber: AnyCancellable? { willSet { if let onChangeSubscriber { onChangeSubscriber.cancel() @@ -82,7 +82,7 @@ open class RadioBoxItem: Control, Changeable { $0.textStyle = .bodyLarge } - public var selectorView = UIView().with { + open var selectorView = UIView().with { $0.translatesAutoresizingMaskIntoConstraints = false } @@ -259,6 +259,7 @@ open class RadioBoxItem: Control, Changeable { sendActions(for: .valueChanged) } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { updateLabels() updateAccessibility() diff --git a/VDS/Components/RadioButton/RadioButtonGroup.swift b/VDS/Components/RadioButton/RadioButtonGroup.swift index 5766d811..4298f827 100644 --- a/VDS/Components/RadioButton/RadioButtonGroup.swift +++ b/VDS/Components/RadioButton/RadioButtonGroup.swift @@ -30,7 +30,7 @@ open class RadioButtonGroup: SelectorGroupSelectedHandlerBase { } } - public var selectorModels: [RadioButtonModel]? { + open var selectorModels: [RadioButtonModel]? { didSet { if let selectorModels { selectorViews = selectorModels.enumerated().map { index, model in @@ -56,7 +56,7 @@ open class RadioButtonGroup: SelectorGroupSelectedHandlerBase { } private var _showError: Bool = false - public var showError: Bool { + open var showError: Bool { get { _showError } set { var newShowError = newValue @@ -116,6 +116,7 @@ open class RadioButtonGroup: SelectorGroupSelectedHandlerBase { extension RadioButtonGroup { public struct RadioButtonModel: Surfaceable, Disabling, Initable, FormFieldable, Errorable { + /// Whether this object is disabled or not public var disabled: Bool /// Current Surface and this is used to pass down to child objects that implement Surfacable public var surface: Surface diff --git a/VDS/Components/RadioSwatch/RadioSwatch.swift b/VDS/Components/RadioSwatch/RadioSwatch.swift index b9ec00c7..f2898f13 100644 --- a/VDS/Components/RadioSwatch/RadioSwatch.swift +++ b/VDS/Components/RadioSwatch/RadioSwatch.swift @@ -32,11 +32,11 @@ open class RadioSwatch: Control { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- - public var selectorView = UIView().with { + open var selectorView = UIView().with { $0.translatesAutoresizingMaskIntoConstraints = false } - public var fillView = UIImageView().with { + open var fillView = UIImageView().with { $0.translatesAutoresizingMaskIntoConstraints = false $0.contentMode = .scaleAspectFit } @@ -125,6 +125,7 @@ open class RadioSwatch: Control { sendActions(for: .valueChanged) } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { layer.setNeedsDisplay() } diff --git a/VDS/Components/RadioSwatch/RadioSwatchGroup.swift b/VDS/Components/RadioSwatch/RadioSwatchGroup.swift index fc3fb801..e7b29b65 100644 --- a/VDS/Components/RadioSwatch/RadioSwatchGroup.swift +++ b/VDS/Components/RadioSwatch/RadioSwatchGroup.swift @@ -21,7 +21,7 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase, UICo } } - public var selectorModels: [RadioSwatchModel]? { + open var selectorModels: [RadioSwatchModel]? { didSet { if let selectorModels { selectorViews = selectorModels.map { model in @@ -46,7 +46,7 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase, UICo //-------------------------------------------------- // MARK: - Private Properties //-------------------------------------------------- - public var label = Label() + open var label = Label() private let cellSize: CGFloat = 48.0 private let labelSpacing: CGFloat = 24.0 private let labelHeight: CGFloat = 16.0 @@ -71,6 +71,7 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase, UICo //-------------------------------------------------- // MARK: - Overrides //-------------------------------------------------- + /// Whether this object is disabled or not override public var disabled: Bool { didSet { for selector in selectorViews { @@ -123,6 +124,7 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase, UICo collectionView.dataSource = self } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { label.textPosition = .left label.textStyle = .bodySmall @@ -190,7 +192,9 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase, UICo extension RadioSwatchGroup { public struct RadioSwatchModel: Surfaceable, Disabling, Initable { + /// Whether this object is disabled or not public var disabled: Bool = false + /// Current Surface and this is used to pass down to child objects that implement Surfacable public var surface: Surface public var inputId: String? public var value: AnyHashable? diff --git a/VDS/Components/Tabs/Tab.swift b/VDS/Components/Tabs/Tab.swift index 4720fabe..ded6aa62 100644 --- a/VDS/Components/Tabs/Tab.swift +++ b/VDS/Components/Tabs/Tab.swift @@ -146,6 +146,7 @@ extension Tabs { layoutGuide.trailingAnchor.constraint(equalTo: trailingAnchor)]) } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() diff --git a/VDS/Components/Tabs/Tabs.swift b/VDS/Components/Tabs/Tabs.swift index 59cfda95..fd7327fe 100644 --- a/VDS/Components/Tabs/Tabs.swift +++ b/VDS/Components/Tabs/Tabs.swift @@ -232,6 +232,7 @@ open class Tabs: View { } } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() diff --git a/VDS/Components/Tabs/TabsContainer.swift b/VDS/Components/Tabs/TabsContainer.swift index ccb01c1c..50eab591 100644 --- a/VDS/Components/Tabs/TabsContainer.swift +++ b/VDS/Components/Tabs/TabsContainer.swift @@ -140,6 +140,7 @@ open class TabsContainer: View { ]) } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() diff --git a/VDS/Components/TextFields/EntryField/EntryField.swift b/VDS/Components/TextFields/EntryField/EntryField.swift index 8f14962e..794b2fa1 100644 --- a/VDS/Components/TextFields/EntryField/EntryField.swift +++ b/VDS/Components/TextFields/EntryField/EntryField.swift @@ -98,7 +98,7 @@ open class EntryField: Control, Changeable { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- - public var onChangeSubscriber: AnyCancellable? { + open var onChangeSubscriber: AnyCancellable? { willSet { if let onChangeSubscriber { onChangeSubscriber.cancel() @@ -258,9 +258,7 @@ open class EntryField: Control, Changeable { readOnly = false } - //-------------------------------------------------- - // MARK: - State - //-------------------------------------------------- + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { containerView.backgroundColor = backgroundColorConfiguration.getColor(self) diff --git a/VDS/Components/TextFields/InputField/InputField.swift b/VDS/Components/TextFields/InputField/InputField.swift index eec960ab..f6df3da8 100644 --- a/VDS/Components/TextFields/InputField/InputField.swift +++ b/VDS/Components/TextFields/InputField/InputField.swift @@ -103,7 +103,7 @@ open class InputField: EntryField, UITextFieldDelegate { $0.font = TextStyle.bodyLarge.font } - public var textFieldTextColorConfiguration: AnyColorable = ViewColorConfiguration().with { + open var textFieldTextColorConfiguration: AnyColorable = ViewColorConfiguration().with { $0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true) $0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false) }.eraseToAnyColorable() @@ -161,6 +161,7 @@ open class InputField: EntryField, UITextFieldDelegate { return inputFieldStackView } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() diff --git a/VDS/Components/TextFields/TextArea/TextArea.swift b/VDS/Components/TextFields/TextArea/TextArea.swift index c4d701d3..eb7e45e0 100644 --- a/VDS/Components/TextFields/TextArea/TextArea.swift +++ b/VDS/Components/TextFields/TextArea/TextArea.swift @@ -53,10 +53,10 @@ open class TextArea: EntryField { $0.isScrollEnabled = false } - public var textViewTextColorConfiguration: AnyColorable = ViewColorConfiguration().with { + open var textViewTextColorConfiguration: AnyColorable = ViewColorConfiguration().with { $0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true) $0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false) - }.eraseToAnyColorable() + }.eraseToAnyColorable() { didSet { setNeedsUpdate() }} internal var minWidthConstraint: NSLayoutConstraint? internal var textViewHeightConstraint: NSLayoutConstraint? @@ -91,6 +91,7 @@ open class TextArea: EntryField { return inputFieldStackView } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() diff --git a/VDS/Components/TileContainer/TileContainer.swift b/VDS/Components/TileContainer/TileContainer.swift index 87693dc9..e96f9f04 100644 --- a/VDS/Components/TileContainer/TileContainer.swift +++ b/VDS/Components/TileContainer/TileContainer.swift @@ -77,26 +77,26 @@ open class TileContainer: Control { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- - public var backgroundImage: UIImage? { didSet{ setNeedsUpdate() } } + open var backgroundImage: UIImage? { didSet{ setNeedsUpdate() } } - public var containerView = View().with { + open var containerView = View().with { $0.isUserInteractionEnabled = false } - public var highlightView = View().with { + open var highlightView = View().with { $0.isUserInteractionEnabled = false } - public var color: BackgroundColor = .white { didSet{ setNeedsUpdate() } } + open var color: BackgroundColor = .white { didSet{ setNeedsUpdate() } } - public var padding: Padding = .padding4X { didSet{ setNeedsUpdate() } } + open var padding: Padding = .padding4X { didSet{ setNeedsUpdate() } } - public var aspectRatio: AspectRatio = .ratio1x1 { didSet{ setNeedsUpdate() } } + open var aspectRatio: AspectRatio = .ratio1x1 { didSet{ setNeedsUpdate() } } - public var imageFallbackColor: Surface = .light { didSet{ setNeedsUpdate() } } + open var imageFallbackColor: Surface = .light { didSet{ setNeedsUpdate() } } private var _width: CGFloat? - public var width: CGFloat? { + open var width: CGFloat? { get { return _width } set { if let newValue, newValue > 100 { @@ -109,7 +109,7 @@ open class TileContainer: Control { } private var _height: CGFloat? - public var height: CGFloat? { + open var height: CGFloat? { get { return _height } set { if let newValue, newValue > 44 { @@ -121,9 +121,9 @@ open class TileContainer: Control { } } - public var showBorder: Bool = false { didSet{ setNeedsUpdate() } } + open var showBorder: Bool = false { didSet{ setNeedsUpdate() } } - public var showDropShadows: Bool = false { didSet{ setNeedsUpdate() } } + open var showDropShadows: Bool = false { didSet{ setNeedsUpdate() } } //-------------------------------------------------- // MARK: - Private Properties @@ -204,6 +204,7 @@ open class TileContainer: Control { setNeedsUpdate() } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() diff --git a/VDS/Components/Tilelet/Tilelet.swift b/VDS/Components/Tilelet/Tilelet.swift index 32eb1dde..7c19a3fa 100644 --- a/VDS/Components/Tilelet/Tilelet.swift +++ b/VDS/Components/Tilelet/Tilelet.swift @@ -162,13 +162,13 @@ open class Tilelet: TileContainer { open var textPostion: TextPosition = .top { didSet { setNeedsUpdate() }} //models - public var badgeModel: BadgeModel? { didSet { setNeedsUpdate() }} - public var titleModel: TitleModel? { didSet { setNeedsUpdate() }} - public var subTitleModel: SubTitleModel? { didSet { setNeedsUpdate() }} + open var badgeModel: BadgeModel? { didSet { setNeedsUpdate() }} + open var titleModel: TitleModel? { didSet { setNeedsUpdate() }} + open var subTitleModel: SubTitleModel? { didSet { setNeedsUpdate() }} //only 1 Icon can be active private var _descriptiveIconModel: DescriptiveIcon? - public var descriptiveIconModel: DescriptiveIcon? { + open var descriptiveIconModel: DescriptiveIcon? { get { _descriptiveIconModel } set { _descriptiveIconModel = newValue; @@ -178,7 +178,7 @@ open class Tilelet: TileContainer { } private var _directionalIconModel: DirectionalIcon? - public var directionalIconModel: DirectionalIcon? { + open var directionalIconModel: DirectionalIcon? { get { _directionalIconModel } set { _directionalIconModel = newValue; @@ -365,6 +365,7 @@ open class Tilelet: TileContainer { } } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() diff --git a/VDS/Components/TitleLockup/TitleLockup.swift b/VDS/Components/TitleLockup/TitleLockup.swift index 599b6364..bf3ea8f0 100644 --- a/VDS/Components/TitleLockup/TitleLockup.swift +++ b/VDS/Components/TitleLockup/TitleLockup.swift @@ -285,6 +285,7 @@ open class TitleLockup: View { setNeedsUpdate() } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() diff --git a/VDS/Components/Toggle/Toggle.swift b/VDS/Components/Toggle/Toggle.swift index e44c1b0f..f96d534a 100644 --- a/VDS/Components/Toggle/Toggle.swift +++ b/VDS/Components/Toggle/Toggle.swift @@ -191,6 +191,7 @@ open class Toggle: Control, Changeable { setNeedsUpdate() } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { updateLabel() toggleView.surface = surface diff --git a/VDS/Components/Toggle/ToggleView.swift b/VDS/Components/Toggle/ToggleView.swift index 55aaf044..8729fb72 100644 --- a/VDS/Components/Toggle/ToggleView.swift +++ b/VDS/Components/Toggle/ToggleView.swift @@ -53,7 +53,7 @@ open class ToggleView: Control, Changeable { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- - public var onChangeSubscriber: AnyCancellable? + open var onChangeSubscriber: AnyCancellable? open var isOn: Bool { get { isSelected } @@ -152,6 +152,7 @@ open class ToggleView: Control, Changeable { setNeedsUpdate() } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { updateToggle() updateAccessibility() diff --git a/VDS/Components/Tooltip/Tooltip.swift b/VDS/Components/Tooltip/Tooltip.swift index 69b3964d..9fe2501c 100644 --- a/VDS/Components/Tooltip/Tooltip.swift +++ b/VDS/Components/Tooltip/Tooltip.swift @@ -154,6 +154,7 @@ open class Tooltip: Control, TooltipLaunchable { setNeedsUpdate() } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() diff --git a/VDS/Components/Tooltip/TooltipAlertViewController.swift b/VDS/Components/Tooltip/TooltipAlertViewController.swift index 5dc22d54..7da2c581 100644 --- a/VDS/Components/Tooltip/TooltipAlertViewController.swift +++ b/VDS/Components/Tooltip/TooltipAlertViewController.swift @@ -13,7 +13,7 @@ import VDSColorTokens open class TooltipAlertViewController: UIViewController, Surfaceable { /// Set of Subscribers for any Publishers for this Control. - public var subscribers = Set() + open var subscribers = Set() //-------------------------------------------------- // MARK: - Private Properties @@ -105,6 +105,7 @@ open class TooltipAlertViewController: UIViewController, Surfaceable { ]) } + /// Function used to make changes to the View based off a change events or from local properties. open func updateView() { view.backgroundColor = backgroundColorConfiguration.getColor(self).withAlphaComponent(0.3) tooltipDialog.surface = surface @@ -222,6 +223,7 @@ open class TooltipDialog: View, UIScrollViewDelegate { heightConstraint?.activate() } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() diff --git a/VDS/Components/Tooltip/TrailingTooltipLabel.swift b/VDS/Components/Tooltip/TrailingTooltipLabel.swift index e3f53436..4a1be607 100644 --- a/VDS/Components/Tooltip/TrailingTooltipLabel.swift +++ b/VDS/Components/Tooltip/TrailingTooltipLabel.swift @@ -62,6 +62,7 @@ open class TrailingTooltipLabel: View, TooltipLaunchable { }.store(in: &subscribers) } + /// Function used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView()