Getting the most out of UITableView

You may not know it by name, but UITableView is a view that powers many of the apps you use everyday.  It is a workhorse of iPhone apps, and I’d like to share some apps that have used it well.

Basics

UITableView has two display modes, grouped and plain.  They are so visually dissimilar, that you may be surprised they’re powered by the same class.  A great example of grouped mode is the built-in Settings app:

Notice that each group has a header text (in this case the groups are “General”, “Security”).  Some groups also have explanatory footer text.

The controls on the right-hand side take a little work, but are not difficult to add.  Nice and simple code to do so can be found in this discussion on stackoverflow.com.  You can add switches with UISwitch, buttons with UIButton, sliders with UISlider, and so on.  Some features like the chevron are better handled by changing the accessory style, not by adding your own accessory control.

Here the table view is in ‘plain’ mode, as seen in the AddressBook app.  There are groups here, too (the alphabetical header), as well as a quick-navigation slider on the right.

Getting Fancy

This terrific article covers all the code necessary to go from the “before” on the left, to the “after” on the right.  Really great stuff.

 

 

 

 

Share and Enjoy:
  • Print
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • Reddit
  • RSS

Leave a Reply

Your email address will not be published. Required fields are marked *