Personally I just have 2 images and change/hide them depending on whether the user clicks it or not, works just as well but its slightly more work than just using the on/off switch
There really isn't a checkbox in the official iPhone user interface. Nor is there a popup trigger/pulldown list. I think you are supposed to use tables that have a check mark in the cell or the on/off switch.
I wonder how picky the App Store reviewers are about apps that don't follow the guidelines in the user interface manual. There have been issues with buttons that were not located on toolbars. The Settings view in the iPhone uses nested tables with ON/OFF switches. I think that's a hint. It's obvious that they don't want developers to use these kinds of controls but the question is how far will they go to prohibit them?
I'd like to use a checkbox or button that changes image when "pushed in" also. Perhaps someone here can point to an app in the App Store that has an example of these or can post some sample routines that can be called. It would be preferable if these had made it through the App Store review process.
In the UICatalog sample, UISegmentedControl example seems to allow only one button to be selected in each bar. And, a touched button does not release when you touch it again. This wouldn't act like three checkboxes side by side. However, if you could deselect a button by touching it that would work. I'm reading that this control doesn't act that way. It only triggers an event when the value has changed (another button in the bar is selected).
I ended up creating my own UICheckbox control and stole the checkbox graphics from OS X. I subclassed a UIButton and made the button action toggle its own selected state.
But i don't know how to do that.
Pls someone help me.....
Tutorial on a simple checkbox in Interface Builder
I found this post, and a couple others, on this topic and dug into it a bit since I need checkboxes too. Have a look at my tutorial on how to create a simple checkbox in Interface Builder. There is source code in the form of a working Xcode project. Let me know how it goes!
you could have 2 UIImageViews one with a box then ontop of that one with a check... the check is defaultly hidden, make an intiger called isClicked;
now when the user presses the image (remember to enable user interaction in your xib file) say
Perhaps Apple has gone through a thorough research on how to make user interface work best for iOS devices and they made up their minds to remove the check box item for the ff reasons I also agree.
Check box can be triggered easily by a "click" using a mouse when using Personal Computers. However, the story becomes different when used in a touch screens like iOS devices.
You might argue and say "What's the difference of tapping a check box from tapping a button? We never had a problem with a UIButton".
Yes that's true. The problem of including a check box in iOS interface IS NOT ONLY about "tapping" but the space required for a finger to FIT and accurately tap inside the check box area.
Usually buttons are much bigger in space and is more isolated (fewer control items are surrounding it) compared to check boxes. On the other hand, check boxes are usually contained inside a TIGHT "configuration window" together with the other control items. In effect, you'll end up accidentally tapping the other controls beside it.
Possible solution is to make the check boxes a little bigger but your sacrificing the available space and making it look too crowded and probably, Apple finds large check boxes unpleasing (i don't know as Aesthetics is very important to this guys).
Apple Solution:
Replace the check box with a UISwitch for the ff reasons:
UISwitch is
1) very accurate and works perfectly in tight "configuration window" since you have to swipe your finger instead of tapping it.
2) small in size (in terms of height) compared to buttons. It doesn't need to be taller to make swiping more accurate. In effect, you can fit more controls vertically.
3) very intuitive It relates to the real world on/off switch objects (ex light switch) and maintains simplicity (which is one of Apples design principles).
UISwitch is
1) very accurate and works perfectly in tight "configuration window" since you have to swipe your finger instead of tapping it.
2) small in size (in terms of height) compared to buttons. It doesn't need to be taller to make swiping more accurate. In effect, you can fit more controls vertically.
3) very intuitive It relates to the real world on/off switch objects (ex light switch) and maintains simplicity (which is one of Apples design principles).
1. You can toggle a UISwitch by just tapping.
2. In terms of size, did you see the UIButtonTypeInfoLight, it's small but you can still tap on it accurately. Which means you can do the same with checkbox.
3. no comment.