Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to unselect a UITableViewCell after you have done some action using didSelectRowAtIndexPath?

Tags:

People also ask

What is deselectRow?

deselectRow(at:animated:)Deselects a row that an index path identifies, with an option to animate the deselection.

What is Table View delegate?

func tableView(UITableView, willDisplay: UITableViewCell, forRowAt: IndexPath) Tells the delegate the table view is about to draw a cell for a particular row. func tableView(UITableView, indentationLevelForRowAt: IndexPath) -> Int. Asks the delegate to return the level of indentation for a row in a given section.


Currently I do some work inside the didSelectRowAtIndexPath delegate and noticed that my row is still "selected" after I come back to the view controller later.

How can I unselect this row inside the delegate itself?

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {   //do logic and ... it remains selected in the view? }