User Tools

Site Tools


Custom Cells

Any object can be subclassed to customize its behavior. UITableViewCells can be subclassed and changed just like UIViewControllers.

p5.jpg A stock UITableViewCell

Custom, subclassed cells.

To subclass a UITableViewCell:

  1. Create a new class, subclass UITableViewCell
  2. Set the class in InterfaceBuilder by selecting a cell in a table and changing its class
  3. Setup the cell by dragging and dropping views onto it
  4. Connect the views to the cell as IBOutlets using assistant editor
  5. Import the class into the table's delegate and change references in cellForRowAtIndexPath from UITableViewCell to the name of your new subclass
ios-labs-s14/intermediate-cells.txt · Last modified: 2014/02/26 13:28 by mbarboi