Hello , is there a way to set the allowsSelection property of UITableView for each table section separately, and not for the whole table ?
Thanks in advance
Hello , is there a way to set the allowsSelection property of UITableView for each table section separately, and not for the whole table ?
Thanks in advance
Doesn't look like it. Here's what you do: use the indexPath.section value to set the cell's .selectionStyle
to UITableViewCellSelectionStyleNone
and to return early from -didSelectRowAtIndexPath
.
In other words, you'll configure cells in certain sectinos to not flash blue when selected, and when it IS selected, not to do anything. It'll be just as if that section had its allowsSelection
property set to NO.
Try using the willSelectRowAtIndexPath method and return nil for the section you don't want to allow selection on.