Silver Challenge: Cell Base Class

The need for a cell to forward an action message to its controller is pretty common. If your cell subclasses inherit this ability, then you don’t have to re-implement this functionality in each subclass. Make a UITableViewCell subclass as a cell base class that just implements the ability to forward action messages to a controller. Make HomepwnerItemCell a subclass of this base class. To test your base class further, create another subclass of it that has a UIStepper on it that will adjust the value of a BNRItem.

Figure 15.12  Cell class hierarchy

Cell class hierarchy

Get iOS Programming: The Big Nerd Ranch Guide 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.