Instance Method

tableView(_:didSelectRowAt:)

Tells the delegate that the specified row is now selected.

Declaration

optional func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)

Parameters

tableView

A table-view object informing the delegate about the new row selection.

indexPath

An index path locating the new selected row in tableView.

Discussion

The delegate handles selections in this method. One of the things it can do is exclusively assign the check-mark image (checkmark) to one row in a section (radio-list style). This method isn’t called when the isEditing property of the table is set to true (that is, the table view is in editing mode). See "€œManaging Selections" in Table View Programming Guide for iOS for further information (and code examples) related to this method.

See Also

Managing Selections

func tableView(UITableView, willSelectRowAt: IndexPath)

Tells the delegate that a specified row is about to be selected.

func tableView(UITableView, willDeselectRowAt: IndexPath)

Tells the delegate that a specified row is about to be deselected.

func tableView(UITableView, didDeselectRowAt: IndexPath)

Tells the delegate that the specified row is now deselected.