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: Storyboards > Static Cells

Static Cells

Next, let's take a look at the new table view configuration that storyboards allow you to use: static cells. Up until now, all the table view cells you've seen (in this chapter and previous chapters) have been created and populated dynamically within a controller's UITableViewDataSource methods. That's great for displaying lists whose size may vary at runtime, but sometimes you know exactly what you want to display. If the number of items and the kinds of cells are known entirely in advance, implementing a dataSource can feel like a chore.

Fortunately, storyboards provide an alternative to dynamic cells: static cells! You can now define a set of cells inside a table view, and they will be displayed in the running app exactly as they are in Interface Builder. Note that these cells are only “static” in the sense that the existence of the cells themselves will be consistent every time you run the app. Their content can change on the fly, however. In fact, you can connect outlets to them in order to access them and set their content from the controller. Let's get started!


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial