2

What is the closest analog to Cocoa's NSSwitchButton checkbox in iOS?

exebook
  • 32,014
  • 33
  • 141
  • 226
user523234
  • 14,323
  • 10
  • 62
  • 102

1 Answers1

3

Have a look at UISwitch. This is the same "lightswitch-style" ON/OFF button that is used in preferences.

UISwitch image

Here is a tutorial on using UISwitch on iOS.

e.James
  • 116,942
  • 41
  • 177
  • 214
  • Is this the only closest substitution? I was hoping something close to the checkbox. Since I will need to have about 8 of them for user to check. – user523234 Jun 07 '11 at 02:40
  • I'm afraid so. However, it is pretty easy to reproduce a more traditional checkbox using a `UIButton` and supplying two different images (one for checked, one for unchecked). See here for more details: http://stackoverflow.com/questions/650131/checkbox-in-iphone-application – e.James Jun 07 '11 at 02:47
  • It looks like the old checkbox will be missed! Thanks. – user523234 Jun 07 '11 at 02:55