Chapter 5Using Table Views

WHAT YOU LEARN IN THIS CHAPTER:

  • Adding a UITableView
  • Creating a data source
  • Editing data in a UITableView
  • Presenting modal views
  • Using segues

WROX.COM CODE DOWNLOADS FOR THIS CHAPTER

You can find the wrox.com code downloads for this chapter at www.wrox.com/go/begiosprogramming on the Download Code tab. The code is in the chapter 05 download and individually named according to the names throughout the chapter.

In this chapter you learn how to use the UITableView. The UITableView is a little different from what you would expect a table to be. They consist of a scroll view with single-row cells instead of a table with multiple columns and rows. A better way to think of them is a scrolling list of cells.

The UITableView is probably the most used view in iOS applications. This is because of their versatility. You can use a UITableView and basic UITableViewCells for a standard look and feel, or you can use a custom UITableViewCell with varying cell heights and content for more complex user interfaces.

An example of a UITableView using basic UITableViewCells is Apple’s Settings app. You can see a more complex example in popular apps such as Facebook and Twitter.

Apple has spent a great deal of time thinking through its implementation, so UITableViews can be used in applications that need to display large data models but need only the visible data in memory. This makes them scroll and animate smoothly while loading and unloading the model objects.

For the ...

Get Beginning iOS Programming: Building and Deploying iOS Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.