Embedding UITables into UIAlertViews

October 10, 2009 by Skylar · 2 Comments
Filed under: iPhone Development 

The newer Apple firmware will create a table in your UIAlertView automatically if you create a more than the number of buttons that fit onto the alert. Note that this number is different in landscape and portrait modes. I found the implementation to be very unappealing for a few reasons. First of all, you won’t really know if you will have buttons or a table until after you compile and test the application. Plus, if you want to display a table, but you only have a few options, then there’s no real way to get that with the standard UIAlertView. And finally, what if you had wanted to customize the table with colored cells, custom cells with images on them, or take advantage of the editing properties of the table and its “Swipe to delete” feature? What if you want a table with multiple sections? You would be able to do none of the above with the standard UIAlertView.

So instead, I decided the best option would be to create another custom UIAlertView whose sole purpose is to display a table.

Read more

Custom UIAlertView (Color chooser)

August 14, 2009 by Skylar · 31 Comments
Filed under: iPhone Development 
PTColorChooser.png

PTColorChooser.png

In this post, I am going to show you how to make a custom UIAlertView, as seen in the above screenshots and this video. The custom UIAlertView is a color picker that is taken right out of my PocketTouch application (available on the AppStore very soon!).

To do anything custom to an alert view, we need to subclass it out. Go ahead and do so, and set up the interface for your UIAlertView like you will see in the following example.
Read more