The delegate of a
UITableView object must adopt the
UITableViewDelegate protocol. Optional methods of the protocol allow the delegate to manage selections, configure section headings and footers, help to delete and reorder cells, and perform other actions.
- iOS 8.0+
- tvOS 9.0+
Many methods of the
UITableViewDelegate protocol take
NSIndexPath objects as parameters and return values. UIKit declares a category on
NSIndexPath that enables you to get the represented row index (
row property) and section index (
section property), and to construct an index path from a given row index and section index (
init(row:section:) method). Because rows are located within their sections, you usually must evaluate the section index number before you can identify the row by its index number.