O'Reilly logo

iOS 8 SDK Development, 2nd Edition by Janie Clayton, Chris Adamson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required