Asks the data source for a cell to insert in a particular location of the table view.
Required.
SDKs
- iOS 2.0+
- tvOS 9.0+
Framework
- UIKit
Declaration
func tableView(_ tableView: UITable View, cellForRowAt indexPath: Index Path) -> UITable View Cell
Parameters
tableView
A table-view object requesting the cell.
indexPath
An index path locating a row in
table
.View
Return Value
An object inheriting from UITable
that the table view can use for the specified row. An assertion is raised if you return nil
.
Discussion
The returned UITable
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 dequeue
message to table
. 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.