IPhone - Is it possible to override UITableViewCell setSelected: animated

I am drawing a custom UITableViewCells. My cells are opaque and fully drawn in drawRect cells to help in performance. I want to handle the appearance of the selected cell. If I do not, the contents of my cell will be closed by the selected addition of BackgroundView. Is it common or acceptable to override the setSelected: animated element of my cell, so this is done correctly. I think if I did this, I would not call the super setSelected method, since I will process as the cell shows that it is selected. I would also have to set the selected property of the cell.

Any help would be great. Thank.

+3
source share
1 answer

You can override -[UITableViewCell setSelected:animated:], but you should always call a super implementation in your implementation. Not doing this can have unintended consequences for other choices.

If you do not want the superclass to make any style changes as a result of the selection, simply set the cell property selectionStyleto UITableViewCellSelectionStyleNone.

+17
source

Source: https://habr.com/ru/post/1740372/


All Articles