Purpose of register(_:forCellReuseIdentifier) function in Swift

The main purpose of the register(_:forCellReuseIdentifier) function is to tell the tableview how to create new cells prior to dequeuing cells. If the cell of specified type is not currently in the reuse queue, tableview automatically creates cell of the specified type.

Parameters:

cellClass : The class of cell that we want to use in tableview.(UITableView  subclass)

identifier: Reuse identifier for the cell.

Leave a Reply