Instance Method



Asks the data source for a cell to insert in a particular location of the table view.


func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell



A table-view object requesting the cell.


An index path locating a row in tableView.

Return Value

An object inheriting from UITableViewCell that the table view can use for the specified row. An assertion is raised if you return nil.


The returned UITableViewCell object is frequently one that the application reuses for performance reasons. You should fetch a previously created cell object that is marked for reuse by sending a dequeueReusableCell(withIdentifier:) message to tableView. Various attributes of a table cell are set automatically based on whether the cell is a separator and on information the data source provides, such as for accessory views and editing controls.

See Also