Is there any way to disable the “selectibility” of a UITableView row?
Example: I would like to make an appointment for a haircut at a certain time with a certain stylist. What gets displayed to a user is a list of times in half hour increments, but unavailable times are grayed out/unselectable.
Yes, set the
selectionStylefor any cells that shouldn’t be selectable toUITableViewCellSelectionStyleNone.Make sure to also set the cell’s that should be selectable to
UITableViewCellSelectionStyleBlueif you’re using areuseIdentifieron the cells.You also need to override
didSelectRowAtIndexPathso that cells with aUITableViewCellSelectionStyleNonestyle are ignored.