Instance Method

indexPath(for:)

Returns an index path representing the row and section of a given table-view cell.

Declaration

func indexPath(for cell: UITableViewCell) -> IndexPath?

Parameters

cell

A cell object of the table view.

Return Value

An index path representing the row and section of the cell, or nil if the index path is invalid.

See Also

Accessing Cells and Sections

func cellForRow(at: IndexPath) -> UITableViewCell?

Returns the table cell at the specified index path.

func indexPathForRow(at: CGPoint) -> IndexPath?

Returns an index path identifying the row and section at the given point.

func indexPathsForRows(in: CGRect) -> [IndexPath]?

An array of index paths each representing a row enclosed by a given rectangle.

var visibleCells: [UITableViewCell]

The table cells that are visible in the table view.

var indexPathsForVisibleRows: [IndexPath]?

An array of index paths each identifying a visible row in the table view.