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
//--------------------------------------------------
/// Executed on initialization for this View.
open override func initialSetup() {
super.initialSetup()
/// 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()
onClick = { control in
control.toggle()
}
@ -116,14 +118,10 @@ open class SelectorBase: Control, SelectorControlable {
guard let self else { return "" }
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
accessibilityTraits = .button
}
open override func updateView() {

View File

@ -157,9 +157,11 @@ open class SelectorItemBase<Selector: SelectorBase>: Control, Errorable, Changea
//--------------------------------------------------
// MARK: - Overrides
//--------------------------------------------------
/// Executed on initialization for this View.
open override func initialSetup() {
super.initialSetup()
/// 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()
onClick = { [weak self] control in
guard let self, isEnabled else { return }
toggle()
@ -204,13 +206,7 @@ open class SelectorItemBase<Selector: SelectorBase>: Control, Errorable, Changea
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
addSubview(mainStackView)