I need to make a toggle button - click once and it stays depressed, click again and it returns to normal state. I can't figure out how to do this with UIKit. Am I missing something?
The only thing built-in that does this is a UISwitch. What you could do is style a single button and link an action to it to store the toggle value, which would also change the style of the button.
I've not dug into the buttons stuff, but if there isn't advanced styling to simulate this, you could get around it with an ugly hack: switching between two buttons w/ linked actions (e.g. createGrayButton/createDarkGrayButton), and disabling animation during the 'hiding' transition.
My terminology is atrociously off, but you get the concept.
Forgive me, but I would question why you're not using a UISwitch? Based on your limited explanation of what you're trying to do, a UISwitch would be the iPhone way to do it. Why change it up? Why not leverage expectations of existing users based on the way the UI works?
Maybe you have a good reason -- I hope so, because a consistent UI is a real boon to users, new and old.
Well, I am developing an audio recording application and the "standard" UI has toggle push buttons for record, pause, stop, play. The slider does not work well in this context.
Take a look at the UIBarButtonItem class. Apple provides system buttons with images for play, pause, forward, rewind etc. My suggestion would be to have a interface like the iPod where there are controls to stop, play, etc. If that doesn't work, just use a simple UIButton with Glass Style and change the tintcolor property. Ofcourse, you can change the appearance/text when user click on it. From my experience, a toggle button is just like a boolean and should be used in places where the needed answer is YES/NO. And if you had noticed (in iPhone), the UIswitches are mostly used for settings management and never actually used for controlling application.