You use the
UISwitch class to create and manage the On/Off buttons used, for example, in the Settings app for options such as Airplane Mode and Bluetooth. These objects are known as switches.
- iOS 2.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
valueChanged 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.
For more information about appearance and behavior configuration, see Switches.