tableView(_:cellForRowAt:)
Asks the data source for a cell to insert in a particular location of the table view.
Declaration
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCellParameters
- tableView:
A table-view object requesting the cell.
- indexPath:
An index path locating a row in
tableView.
Mentioned in
Return Value
An object inheriting from UITableViewCell that the table view can use for the specified row. UIKit raises an assertion if you return nil.
Discussion
In your implementation, create and configure an appropriate cell for the given index path. Create your cell using the table view’s dequeueReusableCell(withIdentifier:for:) method, which recycles or creates the cell for you. After creating the cell, update the properties of the cell with appropriate data values.
Never call this method yourself. If you want to retrieve cells from your table, call the table view’s cellForRow(at:) method instead.