using setup() now

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-08-09 14:37:36 -05:00
parent 973e25034e
commit 59294ebd51
2 changed files with 13 additions and 19 deletions

View File

@ -100,9 +100,11 @@ open class SelectorBase: Control, SelectorControlable {
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Overrides // MARK: - Overrides
//-------------------------------------------------- //--------------------------------------------------
/// Executed on initialization for this View.
open override func initialSetup() { /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
super.initialSetup() open override func setup() {
super.setup()
onClick = { control in onClick = { control in
control.toggle() control.toggle()
} }
@ -116,14 +118,10 @@ open class SelectorBase: Control, SelectorControlable {
guard let self else { return "" } guard let self else { return "" }
return !isEnabled ? "" : "Double tap to activate." return !isEnabled ? "" : "Double tap to activate."
} }
}
/// 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 isAccessibilityElement = true
accessibilityTraits = .button accessibilityTraits = .button
} }
open override func updateView() { open override func updateView() {

View File

@ -157,9 +157,11 @@ open class SelectorItemBase<Selector: SelectorBase>: Control, Errorable, Changea
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Overrides // MARK: - Overrides
//-------------------------------------------------- //--------------------------------------------------
/// Executed on initialization for this View.
open override func initialSetup() { /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
super.initialSetup() open override func setup() {
super.setup()
onClick = { [weak self] control in onClick = { [weak self] control in
guard let self, isEnabled else { return } guard let self, isEnabled else { return }
toggle() toggle()
@ -204,12 +206,6 @@ open class SelectorItemBase<Selector: SelectorBase>: Control, Errorable, Changea
return !isEnabled ? "" : "Double tap to activate." return !isEnabled ? "" : "Double tap to activate."
} }
}
/// 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()
selectorView.isAccessibilityElement = true selectorView.isAccessibilityElement = true
isAccessibilityElement = false isAccessibilityElement = false
addSubview(mainStackView) addSubview(mainStackView)