diff --git a/VDS/Classes/Control.swift b/VDS/Classes/Control.swift index b9a1baea..54f32f8f 100644 --- a/VDS/Classes/Control.swift +++ b/VDS/Classes/Control.swift @@ -95,7 +95,6 @@ open class Control: UIControl, ViewProtocol, UserInfoable, Clickable { // MARK: - Lifecycle //-------------------------------------------------- - /// Executed on initialization for this Control. open func initialSetup() { if !initialSetupPerformed { initialSetupPerformed = true diff --git a/VDS/Classes/SelectorBase.swift b/VDS/Classes/SelectorBase.swift index 2c9bb03e..7daa1802 100644 --- a/VDS/Classes/SelectorBase.swift +++ b/VDS/Classes/SelectorBase.swift @@ -81,6 +81,7 @@ open class SelectorBase: Control, SelectorControlable { /// The natural size for the receiving view, considering only properties of the view itself. open override var intrinsicContentSize: CGSize { size } + /// Executed on initialization for this View. open override func initialSetup() { super.initialSetup() onClick = { control in diff --git a/VDS/Classes/SelectorItemBase.swift b/VDS/Classes/SelectorItemBase.swift index 43deef15..cdb17158 100644 --- a/VDS/Classes/SelectorItemBase.swift +++ b/VDS/Classes/SelectorItemBase.swift @@ -158,6 +158,7 @@ open class SelectorItemBase: Control, Errorable, //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- + /// Executed on initialization for this View. open override func initialSetup() { super.initialSetup() onClick = { control in diff --git a/VDS/Classes/View.swift b/VDS/Classes/View.swift index faa2b644..8f3a3e8b 100644 --- a/VDS/Classes/View.swift +++ b/VDS/Classes/View.swift @@ -53,8 +53,6 @@ open class View: UIView, ViewProtocol, UserInfoable { //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- - - /// Executed on initialization for this View. open func initialSetup() { if !initialSetupPerformed { initialSetupPerformed = true diff --git a/VDS/Components/Badge/Badge.swift b/VDS/Components/Badge/Badge.swift index 59820006..a1636e0a 100644 --- a/VDS/Components/Badge/Badge.swift +++ b/VDS/Components/Badge/Badge.swift @@ -109,7 +109,7 @@ open class Badge: View { //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- - + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() diff --git a/VDS/Components/BadgeIndicator/BadgeIndicator.swift b/VDS/Components/BadgeIndicator/BadgeIndicator.swift index 7ef2edbb..5894afcc 100644 --- a/VDS/Components/BadgeIndicator/BadgeIndicator.swift +++ b/VDS/Components/BadgeIndicator/BadgeIndicator.swift @@ -250,7 +250,7 @@ open class BadgeIndicator: View { //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- - + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() @@ -286,26 +286,7 @@ open class BadgeIndicator: View { shouldUpdateView = true setNeedsUpdate() } - - public func updateTextColorConfig() { - textColorConfiguration.reset() - - switch fillColor { - - case .red, .black, .gray, .grayLowContrast: - textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOndark, forDisabled: false) - textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOndark, forDisabled: true) - - case .yellow, .white: - textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOnlight, forDisabled: false) - textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOnlight, forDisabled: true) - - case .orange, .green, .blue: - textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight, forDisabled: false) - textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight, forDisabled: true) - } - } - + /// Used to make changes to the View based off a change events or from local properties. open override func updateView() { super.updateView() @@ -347,6 +328,25 @@ open class BadgeIndicator: View { layoutIfNeeded() } + private func updateTextColorConfig() { + textColorConfiguration.reset() + + switch fillColor { + + case .red, .black, .gray, .grayLowContrast: + textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOndark, forDisabled: false) + textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOndark, forDisabled: true) + + case .yellow, .white: + textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOnlight, forDisabled: false) + textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOnlight, forDisabled: true) + + case .orange, .green, .blue: + textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight, forDisabled: false) + textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight, forDisabled: true) + } + } + private func getText() -> String { let badgeCount = number ?? 0 var text: String = "" diff --git a/VDS/Components/Buttons/Button/Button.swift b/VDS/Components/Buttons/Button/Button.swift index 85cab228..b895e33c 100644 --- a/VDS/Components/Buttons/Button/Button.swift +++ b/VDS/Components/Buttons/Button/Button.swift @@ -124,7 +124,7 @@ open class Button: ButtonBase, Useable { //-------------------------------------------------- // MARK: - Public Methods //-------------------------------------------------- - + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() isAccessibilityElement = true diff --git a/VDS/Components/Buttons/Button/ButtonBase.swift b/VDS/Components/Buttons/Button/ButtonBase.swift index 35daa8c3..92d5dca9 100644 --- a/VDS/Components/Buttons/Button/ButtonBase.swift +++ b/VDS/Components/Buttons/Button/ButtonBase.swift @@ -139,7 +139,6 @@ open class ButtonBase: UIButton, Buttonable, ViewProtocol, UserInfoable, Clickab } - /// Resets to default settings. open func reset() { shouldUpdateView = false surface = .light diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift index 3b71f6f9..8f1e7864 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift @@ -127,7 +127,7 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega //-------------------------------------------------- // MARK: - Public Methods //-------------------------------------------------- - + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() addSubview(collectionView) diff --git a/VDS/Components/Buttons/TextLink/TextLink.swift b/VDS/Components/Buttons/TextLink/TextLink.swift index 48480f29..303ebc84 100644 --- a/VDS/Components/Buttons/TextLink/TextLink.swift +++ b/VDS/Components/Buttons/TextLink/TextLink.swift @@ -72,6 +72,7 @@ open class TextLink: ButtonBase { //-------------------------------------------------- // MARK: - Public Methods //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() isAccessibilityElement = true diff --git a/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift b/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift index 61fa5b5d..6823c2f5 100644 --- a/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift +++ b/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift @@ -75,6 +75,7 @@ open class TextLinkCaret: ButtonBase { //-------------------------------------------------- // MARK: - Public Methods //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() accessibilityTraits = .link diff --git a/VDS/Components/Checkbox/Checkbox.swift b/VDS/Components/Checkbox/Checkbox.swift index 1179e58e..95a81016 100644 --- a/VDS/Components/Checkbox/Checkbox.swift +++ b/VDS/Components/Checkbox/Checkbox.swift @@ -16,6 +16,7 @@ open class Checkbox: SelectorBase { open var isAnimated: Bool = false { didSet { setNeedsUpdate() }} + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() accessibilityLabel = "Checkbox" diff --git a/VDS/Components/Checkbox/CheckboxGroup.swift b/VDS/Components/Checkbox/CheckboxGroup.swift index 151a8d1a..dade0aa3 100644 --- a/VDS/Components/Checkbox/CheckboxGroup.swift +++ b/VDS/Components/Checkbox/CheckboxGroup.swift @@ -92,6 +92,7 @@ open class CheckboxGroup: SelectorGroupHandlerBase { //-------------------------------------------------- // MARK: - Overrides //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() diff --git a/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift b/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift index bcb194ac..70329b5d 100644 --- a/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift +++ b/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift @@ -224,6 +224,7 @@ open class ButtonIcon: Control { //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() diff --git a/VDS/Components/Icon/Icon.swift b/VDS/Components/Icon/Icon.swift index d466c627..9f6e9810 100644 --- a/VDS/Components/Icon/Icon.swift +++ b/VDS/Components/Icon/Icon.swift @@ -47,6 +47,7 @@ open class Icon: View { // MARK: - Overrides //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() diff --git a/VDS/Components/Label/Label.swift b/VDS/Components/Label/Label.swift index 16c676d4..0f9ddcd3 100644 --- a/VDS/Components/Label/Label.swift +++ b/VDS/Components/Label/Label.swift @@ -111,7 +111,6 @@ open class Label: UILabel, ViewProtocol, UserInfoable { open func setup() {} - /// Resets to default settings. open func reset() { shouldUpdateView = false surface = .light diff --git a/VDS/Components/Line/Line.swift b/VDS/Components/Line/Line.swift index 60f76dcb..990bc1e2 100644 --- a/VDS/Components/Line/Line.swift +++ b/VDS/Components/Line/Line.swift @@ -59,6 +59,7 @@ open class Line: View { orientation = .horizontal } + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() } diff --git a/VDS/Components/Loader/Loader.swift b/VDS/Components/Loader/Loader.swift index ecd75b0f..2301b5aa 100644 --- a/VDS/Components/Loader/Loader.swift +++ b/VDS/Components/Loader/Loader.swift @@ -40,6 +40,7 @@ open class Loader: View { //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() addSubview(icon) diff --git a/VDS/Components/Notification/Notification.swift b/VDS/Components/Notification/Notification.swift index 7f8f630d..7db1724e 100644 --- a/VDS/Components/Notification/Notification.swift +++ b/VDS/Components/Notification/Notification.swift @@ -206,6 +206,7 @@ open class Notification: View { // MARK: - Lifecycle //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() addSubview(mainStackView) diff --git a/VDS/Components/RadioBox/RadioBoxGroup.swift b/VDS/Components/RadioBox/RadioBoxGroup.swift index f11b7acb..1bbf9a6c 100644 --- a/VDS/Components/RadioBox/RadioBoxGroup.swift +++ b/VDS/Components/RadioBox/RadioBoxGroup.swift @@ -82,6 +82,7 @@ open class RadioBoxGroup: SelectorGroupSelectedHandlerBase { } } + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() addSubview(mainStackView) diff --git a/VDS/Components/RadioBox/RadioBoxItem.swift b/VDS/Components/RadioBox/RadioBoxItem.swift index 2ce7edba..0c0e69c5 100644 --- a/VDS/Components/RadioBox/RadioBoxItem.swift +++ b/VDS/Components/RadioBox/RadioBoxItem.swift @@ -156,6 +156,7 @@ open class RadioBoxItem: Control, Changeable { //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- + /// Executed on initialization for this View. open override func initialSetup() { super.initialSetup() onClick = { control in @@ -163,6 +164,7 @@ open class RadioBoxItem: Control, Changeable { } } + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() @@ -271,6 +273,7 @@ open class RadioBoxItem: Control, Changeable { layoutIfNeeded() } + /// Used to update any Accessibility properties. open override func updateAccessibility() { super.updateAccessibility() if accessibilityLabel == nil { diff --git a/VDS/Components/RadioButton/RadioButton.swift b/VDS/Components/RadioButton/RadioButton.swift index 65ad5485..e55d191f 100644 --- a/VDS/Components/RadioButton/RadioButton.swift +++ b/VDS/Components/RadioButton/RadioButton.swift @@ -16,6 +16,7 @@ open class RadioButton: SelectorBase { open var selectedSize = CGSize(width: 10, height: 10) { didSet { setNeedsUpdate() }} + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() diff --git a/VDS/Components/RadioButton/RadioButtonGroup.swift b/VDS/Components/RadioButton/RadioButtonGroup.swift index ef86ac6c..f3898d86 100644 --- a/VDS/Components/RadioButton/RadioButtonGroup.swift +++ b/VDS/Components/RadioButton/RadioButtonGroup.swift @@ -86,6 +86,7 @@ open class RadioButtonGroup: SelectorGroupSelectedHandlerBase { //-------------------------------------------------- // MARK: - Overrides //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() diff --git a/VDS/Components/RadioSwatch/RadioSwatch.swift b/VDS/Components/RadioSwatch/RadioSwatch.swift index 18a2e866..ff8308a6 100644 --- a/VDS/Components/RadioSwatch/RadioSwatch.swift +++ b/VDS/Components/RadioSwatch/RadioSwatch.swift @@ -74,6 +74,7 @@ open class RadioSwatch: Control { //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- + /// Executed on initialization for this View. open override func initialSetup() { super.initialSetup() onClick = { control in @@ -81,6 +82,7 @@ open class RadioSwatch: Control { } } + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() diff --git a/VDS/Components/RadioSwatch/RadioSwatchGroup.swift b/VDS/Components/RadioSwatch/RadioSwatchGroup.swift index d4d24fa6..a420022f 100644 --- a/VDS/Components/RadioSwatch/RadioSwatchGroup.swift +++ b/VDS/Components/RadioSwatch/RadioSwatchGroup.swift @@ -90,6 +90,7 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase, UICo } } + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() diff --git a/VDS/Components/Tabs/Tab.swift b/VDS/Components/Tabs/Tab.swift index a5b06a48..1935e25c 100644 --- a/VDS/Components/Tabs/Tab.swift +++ b/VDS/Components/Tabs/Tab.swift @@ -122,7 +122,8 @@ extension Tabs { // MARK: - Overrides //-------------------------------------------------- - open override func setup() { + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. + open override func setup() { super.setup() canHighlight = false @@ -171,6 +172,7 @@ extension Tabs { } + /// Used to update any Accessibility properties. open override func updateAccessibility() { super.updateAccessibility() accessibilityLabel = text diff --git a/VDS/Components/Tabs/Tabs.swift b/VDS/Components/Tabs/Tabs.swift index 6c4c4462..239075a7 100644 --- a/VDS/Components/Tabs/Tabs.swift +++ b/VDS/Components/Tabs/Tabs.swift @@ -166,6 +166,7 @@ open class Tabs: View { //-------------------------------------------------- // MARK: - Overrides //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() scrollView = UIScrollView() diff --git a/VDS/Components/Tabs/TabsContainer.swift b/VDS/Components/Tabs/TabsContainer.swift index 9abc1f0b..4c62fd5f 100644 --- a/VDS/Components/Tabs/TabsContainer.swift +++ b/VDS/Components/Tabs/TabsContainer.swift @@ -123,6 +123,7 @@ open class TabsContainer: View { private var tabMenuLayoutGuide = UILayoutGuide() + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() diff --git a/VDS/Components/TextFields/EntryField/EntryField.swift b/VDS/Components/TextFields/EntryField/EntryField.swift index 86e6fd5b..5cf71554 100644 --- a/VDS/Components/TextFields/EntryField/EntryField.swift +++ b/VDS/Components/TextFields/EntryField/EntryField.swift @@ -179,6 +179,7 @@ open class EntryField: Control, Changeable { //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() diff --git a/VDS/Components/TextFields/InputField/InputField.swift b/VDS/Components/TextFields/InputField/InputField.swift index a7260b02..17c86131 100644 --- a/VDS/Components/TextFields/InputField/InputField.swift +++ b/VDS/Components/TextFields/InputField/InputField.swift @@ -114,6 +114,7 @@ open class InputField: EntryField, UITextFieldDelegate { //-------------------------------------------------- // MARK: - Overrides //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() diff --git a/VDS/Components/TextFields/TextArea/TextArea.swift b/VDS/Components/TextFields/TextArea/TextArea.swift index a9843dad..31e11542 100644 --- a/VDS/Components/TextFields/TextArea/TextArea.swift +++ b/VDS/Components/TextFields/TextArea/TextArea.swift @@ -64,6 +64,7 @@ open class TextArea: EntryField { //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() diff --git a/VDS/Components/TileContainer/TileContainer.swift b/VDS/Components/TileContainer/TileContainer.swift index 0050630d..9b046e9b 100644 --- a/VDS/Components/TileContainer/TileContainer.swift +++ b/VDS/Components/TileContainer/TileContainer.swift @@ -149,6 +149,7 @@ open class TileContainer: Control { // MARK: - Lifecycle //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() addSubview(backgroundImageView) diff --git a/VDS/Components/Tilelet/Tilelet.swift b/VDS/Components/Tilelet/Tilelet.swift index 218b037b..97425a5a 100644 --- a/VDS/Components/Tilelet/Tilelet.swift +++ b/VDS/Components/Tilelet/Tilelet.swift @@ -199,6 +199,7 @@ open class Tilelet: TileContainer { // MARK: - Lifecycle //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() width = 100 @@ -376,6 +377,7 @@ open class Tilelet: TileContainer { layoutIfNeeded() } + /// Used to update any Accessibility properties. open override func updateAccessibility() { super.updateAccessibility() diff --git a/VDS/Components/TitleLockup/TitleLockup.swift b/VDS/Components/TitleLockup/TitleLockup.swift index caa42202..5f34c050 100644 --- a/VDS/Components/TitleLockup/TitleLockup.swift +++ b/VDS/Components/TitleLockup/TitleLockup.swift @@ -254,6 +254,7 @@ open class TitleLockup: View { //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() diff --git a/VDS/Components/Toggle/Toggle.swift b/VDS/Components/Toggle/Toggle.swift index 3f8c12f2..6e93a75d 100644 --- a/VDS/Components/Toggle/Toggle.swift +++ b/VDS/Components/Toggle/Toggle.swift @@ -133,6 +133,7 @@ open class Toggle: Control, Changeable { //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- + /// Executed on initialization for this View. open override func initialSetup() { super.initialSetup() onClick = { control in @@ -140,6 +141,7 @@ open class Toggle: Control, Changeable { } } + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() @@ -205,6 +207,7 @@ open class Toggle: Control, Changeable { toggleView.isOn = isOn } + /// Used to update any Accessibility properties. open override func updateAccessibility() { super.updateAccessibility() diff --git a/VDS/Components/Toggle/ToggleView.swift b/VDS/Components/Toggle/ToggleView.swift index 882793f3..bf9eb4c8 100644 --- a/VDS/Components/Toggle/ToggleView.swift +++ b/VDS/Components/Toggle/ToggleView.swift @@ -105,6 +105,7 @@ open class ToggleView: Control, Changeable { //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- + /// Executed on initialization for this View. open override func initialSetup() { super.initialSetup() onClick = { control in @@ -112,6 +113,7 @@ open class ToggleView: Control, Changeable { } } + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() @@ -172,6 +174,7 @@ open class ToggleView: Control, Changeable { updateToggle() } + /// Used to update any Accessibility properties. open override func updateAccessibility() { super.updateAccessibility() diff --git a/VDS/Components/Tooltip/Tooltip.swift b/VDS/Components/Tooltip/Tooltip.swift index ea2327b5..c5db18c5 100644 --- a/VDS/Components/Tooltip/Tooltip.swift +++ b/VDS/Components/Tooltip/Tooltip.swift @@ -108,6 +108,7 @@ open class Tooltip: Control, TooltipLaunchable { // MARK: - Lifecycle //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() @@ -154,6 +155,7 @@ open class Tooltip: Control, TooltipLaunchable { icon.color = iconColorConfiguration.getColor(self) } + /// Used to update any Accessibility properties. open override func updateAccessibility() { super.updateAccessibility() diff --git a/VDS/Components/Tooltip/TooltipDialog.swift b/VDS/Components/Tooltip/TooltipDialog.swift index f87fb52e..9341f127 100644 --- a/VDS/Components/Tooltip/TooltipDialog.swift +++ b/VDS/Components/Tooltip/TooltipDialog.swift @@ -77,6 +77,7 @@ open class TooltipDialog: View, UIScrollViewDelegate { //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() @@ -212,6 +213,7 @@ open class TooltipDialog: View, UIScrollViewDelegate { $0.accessibilityFrameInContainerSpace = .init(origin: .zero, size: .init(width: fullWidth, height: VDSLayout.Spacing.space1X.value)) } + /// Used to update any Accessibility properties. open override func updateAccessibility() { super.updateAccessibility() diff --git a/VDS/Components/Tooltip/TrailingTooltipLabel.swift b/VDS/Components/Tooltip/TrailingTooltipLabel.swift index a68dfbbf..2171b374 100644 --- a/VDS/Components/Tooltip/TrailingTooltipLabel.swift +++ b/VDS/Components/Tooltip/TrailingTooltipLabel.swift @@ -45,6 +45,7 @@ open class TrailingTooltipLabel: View, TooltipLaunchable { //-------------------------------------------------- // MARK: - Overrides //-------------------------------------------------- + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() diff --git a/VDS/Protocols/ViewProtocol.swift b/VDS/Protocols/ViewProtocol.swift index 82382ec7..da730372 100644 --- a/VDS/Protocols/ViewProtocol.swift +++ b/VDS/Protocols/ViewProtocol.swift @@ -16,6 +16,9 @@ public protocol ViewProtocol: AnyObject, Initable, Resettable, Enabling, Surface /// Key of whether or not updateView() is called in setNeedsUpdate() var shouldUpdateView: Bool { get set } + /// Executed on initialization for this View. + func initialSetup() + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. func setup()