Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 10: Improving the Cell’s Interaction - Pg. 241

Chapter 10 Improving the Cell's Interaction So far, the cells that you have been creating have been relatively static: the user's interaction with them has been limited to tapping for selection and editing. That's not all you can do with cells, though, so this chapter looks at some of the tricks you can use to make the table view truly interactive: Embedding custom controls including buttons, switches, and sliders within the cell Implementing the widely used pull-to-refresh functionality Adding gesture recognizers to cells to support double taps and so on Adding swipe functionality to reveal hidden details Implementing search within the table's contents No matter how interactive the table is, however, it's not going to deliver a good user experience if it's not responsive. Although we've been covering best-practice as we've gone along in earlier chapters, this chapter finishes up by looking at a checklist of ways to ensure that you squeeze maximum performance from your table views. Embedding Custom Controls into Cells Up to now, you've been mainly concerned with creating and presenting largely static tables. Although you've created cells that present dynamic data, the cells themselves have so far only responded to the basic taps and swipes associated with editing, deleting, and sorting. Because UITableViewCell is a subclass of UIView, it allows you to do pretty much anything you can do with a "standard" UIView. This includes embedding custom 241