Custom Table Cells

To create a custom table cell, it usually makes sense to create a subclass of UITableViewCell and give it public properties for the fields that we’ll need to update from tableView(cellForRowAtIndexPath:). So, in the File Navigator, select the Pragmatic Tweets group, choose File > New > File, and select 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 9 SDK Development 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.