O'Reilly logo

Pro iOS Table Views for iPhone, iPad, and iPod Touch by Tim Duckett

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

Chapter 9

Creating Custom Cells with Subclasses

In Chapter 8, you looked at two of the three main ways of creating and configuring custom UITableViewCells:

  • Adding subviews to the cell's built-in contentView
  • Creating a custom cell from scratch and instantiating it from a nib file.

The third approach – which provides the greatest flexibility, albeit at the cost of slightly more complexity – is to create a custom subclass of UITableViewCell.

The main reasons for using this approach is that you need multiple types of cell in the same table, or you want a level of control over the contents that is awkward to achieve by adding subviews.

In this chapter, we will look at the different ways of creating custom cells with UITableViewCell subclasses. ...

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