Iphone Tutorials UI Switch Control
Switch in an iphone application is very similar to its electronic counterpart in its working. By default it is set to OFF. You can change its value manually or programmatically (as you prefer). When the switch is pressed, it toggles with animation and changes its state from ON to OFF or OFF to ON. For eg. It can be used to mute or unmute volume.
In this tutorial, we will change the value of the switch manually and programmatically. So lets get started.
Step 1: Start Xcode and create a view based application with name “SegmentedControlDemo”.
Step 2: Put the following code in “SwitchDemoViewController.h” file.