UITableView
extension UITableView: CellDequeuing
extension UITableView: CellRegistering
-
Helper method for dequeuing reusable cells of type CellType that handles errors with a crash.
Usage:
tableView.dequeueReusableCell(YourCustomCell.self, for: indexPath)
Declaration
Swift
func dequeueReusableCell<CellType: UITableViewCell>( _ type: CellIdentifiable.Type, for indexPath: IndexPath ) -> CellType
Parameters
type
Type of the UITableViewCell to be dequeued. ie: YourCustomCell.self.
indexPath
IndexPath for the cell.
-
Helper method for registering reusable cells of type CellType in a table view.
Usage:
tableView.register(YourCustomCell.self)
Declaration
Swift
func register<CellType>(_ type: CellType.Type) where CellType : CellIdentifiable
Parameters
type
Type of the UITableViewCell to be dequeued. ie: YourCustomCell.self.