UIButton
already supports a “switch” functionality.
Just set a different image in Interface Builder for the “Selected State Configuration”, and use the selected
property of UIButton
to toggle its state.
More Related Contents:
- How to know the UITableview row number
- Subclass UIButton to add a property
- Gesture recognizer and button actions
- Aligning text and image on UIButton with imageEdgeInsets and titleEdgeInsets
- UITableViewCell expand on click
- Interaction beyond bounds of UIView
- UIButton: set image for selected-highlighted state
- Why does UINavigationBar steal touch events?
- Change color of UISwitch in “off” state
- How to customize UISwitch button in iphone?
- Way to make a UIButton continuously fire during a press-and-hold situation?
- UIButton block equivalent to addTarget:action:forControlEvents: method?
- Best radio-button implementation for IOS
- Changing the text on a UISwitch
- How to get click event from a button added over MKAnnotationView
- How to override -drawrect in UIButton subclass?
- UISwitch in a UITableView cell
- position: fixed doesn’t work on iPad and iPhone
- How to load a UIView using a nib file created with Interface Builder
- How to install iPhone application in iPhone Simulator
- Xcode 5 and iOS 7: Architecture and Valid architectures
- Custom iPhone Keyboard
- How to use beginBackgroundTaskWithExpirationHandler for already running task in iOS
- Downloading a Large File – iPhone SDK
- Send image to server as binary data
- Comparison of JSON Parser for Objective-C (JSON Framework, YAJL, TouchJSON, etc)
- Fetch Contacts in iOS 7
- If I use the PayPal gateway in my iPhone app, will Apple approve it? [closed]
- How to set a picture programmatically in a NavBar?
- How to handle duplicate symbol error from 3rd party libraries?