I’m using this class to make a custom switch: https://github.com/robertchin/rcswitch
It subclasses UIControl. I can switch it on and off, but how do I detect this in the code? UISwitch has a .on property that I can check when the value changes, but UIControl doesn’t have that.
According to the header file for the
RCSwitchclass, there is anonproperty, so you should be able to usemySwitch.on. Alternatively you could use[mySwitch isOn]as the getter has been specified in the property declaration.