Thursday, June 6, 2013

UITableView allowsSelection example in Objective C (iOS).


UITableView allowsSelection

A Boolean value that determines whether users can select a row.

@property(nonatomic) BOOL allowsSelection

Discussion of [UITableView allowsSelection]
If the value of this property is YES (the default), users can select rows. If you set it to NO, they cannot select rows. Setting this property affects cell selection only when the table view is not in editing mode. If you want to restrict selection of cells in editing mode, use allowsSelectionDuringEditing.

UITableView allowsSelection example.
To disable selection in the entire table,

[tableView setAllowsSelection:NO];

Example of [UITableView allowsSelection].
To enable selection in the entire table,

[tableView setAllowsSelection: YES];

End of UITableView allowsSelection example article.