A control that offers a binary choice, such as On/Off.
- iOS 2.0+
- Mac Catalyst 13.0+
UISwitch class declares a property and a method to control its on/off state. As with
UISlider, when the user manipulates the switch control (“flips” it) a
value event is generated, which results in the control (if properly configured) sending an action message.
You can customize the appearance of the switch by changing the color used to tint the switch when it is on or off.
For information about basic view behaviors, see View Programming Guide for iOS.