UITableView Touch-up

There's a good chance that you have built a simple app before, or maybe you have tried but didn't quite succeed. If this is the case, it is likely that you have used UITableView or UITableViewControllerUITableView is a core component of many iOS applications. If an app shows a list of things, it was likely built using UITableViewBecause UITableView is such an essential component on iOS, I want to make sure that we cover it right away in this book. It doesn't matter whether you have looked at UITableView before. This chapter will ensure that you are up to speed with the ins and outs of UITableView and understand how Apple has made sure that every table view scrolls with a smooth speed of 60 frames per second, which we all strive for when developing apps.

In addition to covering the basics of UITableView, such as how it uses delegation to obtain information about the contents it should display, you'll also learn the basics about accessing a user's data, in this case, their contacts. The application that you will end up building displays a list of the user's contacts in a table view.

Every UITableView uses cells to render each item it displays. In this chapter, you will create your own UITableViewCell that uses Auto Layout. Auto Layout is a layout technique that is used throughout this book due to its essential part of every iOS developer's toolkit. If you haven't used Auto Layout before, or if you haven't heard of it, that's OK. This chapter starts with the basics, and your knowledge will expand as you go through this book.

In summary, this chapter covers:

  • Configuring and displaying UITableView
  • Fetching a user's contacts through Contacts.framework
  • The delegate and data source of UITableView
  • Creating a custom UITableViewCell
  • UITableView performance characteristics