CXTDT-599736 - Unable to turn off the Toggles for Privacy preferences

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-08-09 11:22:26 -05:00
parent 317cf89fb6
commit f713cc0659
2 changed files with 16 additions and 18 deletions

View File

@ -153,19 +153,18 @@ open class Toggle: Control, Changeable, FormFieldable {
//--------------------------------------------------
// MARK: - Overrides
//--------------------------------------------------
/// Executed on initialization for this View.
open override func initialSetup() {
super.initialSetup()
onClick = { control in
control.toggle()
}
}
//--------------------------------------------------
/// 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()
publisher(for: .touchUpInside)
.sink(receiveValue: { [weak self] _ in
guard let self else { return }
toggle()
})
.store(in: &subscribers)
isAccessibilityElement = true
if #available(iOS 17.0, *) {
accessibilityTraits = .toggleButton

View File

@ -105,17 +105,16 @@ open class ToggleView: Control, Changeable, FormFieldable {
//--------------------------------------------------
// MARK: - Overrides
//--------------------------------------------------
/// Executed on initialization for this View.
open override func initialSetup() {
super.initialSetup()
onClick = { control in
control.toggle()
}
}
/// 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()
publisher(for: .touchUpInside)
.sink(receiveValue: { [weak self] _ in
guard let self else { return }
toggle()
})
.store(in: &subscribers)
isAccessibilityElement = true
if #available(iOS 17.0, *) {