The listener is only called when the UISwitch
gets toggled by the user touching it. If you programmatically set it, the listener won't be called. But since you're programmatically changing it, just call your listener yourself at the time you change it.
Implementing an onValueChange for a UISwitch in OBJ-C but not when the user touches/changes the value
-
07-10-2022 - |
Domanda
Is there way to implement an onValueChange listener in Xcode/Objective C for an UISwitch but not an onTouch listener? So I want a method to be called when the value of the UISwitch changes without user input. (This will happen programatically via a text SMS service)
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow