Custom Table Cells

To create a custom table cell, it usually makes sense to create a subclass of UITableViewCell and give that subclass public properties for the fields that we’ll need to update from tableView(cellForRowAtIndexPath:). So, in the File Navigator, select the Pragmatic Tweets group, go to FileNewFile, and choose the Cocoa Touch Class template. In the next pane of the assistant, name the class ParsedTweetCell, and set the Subclass of: to UITableViewCell. We don’t need to do anything with the code yet, but it will help us in the Storyboard to have this class already created.

Back in Main.storyboard, select the table view. We could edit the existing prototype cell, but just to prove that we can juggle multiple prototypes, let’s create ...

Get iOS 8 SDK Development, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.