Slide 21
Slide 21 text
func registerNib(
sameNibNameAndIdentifierAs cellClass: Cell.Type) {
registerNib(
UINib(nibName: "\(cellClass)", bundle: nil),
forCellReuseIdentifier: "\(cellClass)")
}
func registerClass(
sameIdentifierAs cellClass: Cell.Type) {
registerClass(cellClass, forCellReuseIdentifier: "\(cellClass)")
}
func dequeue(
sameIdentifierAs cellClass: Cell.Type,
forIndexPath indexPath: NSIndexPath) -> Cell {
return dequeueReusableCellWithIdentifier(
"\(cellClass)",
forIndexPath: indexPath
) as! Cell
}