objective c - Trying to make a table cell return to it's original state after swipe to reveal in iOS -


"postprint" itemprop = "text">

I will delete the feature to give a UITableView option where I remove the user line using Swipe. However, I have also implemented a warning view that triggers when selecting a user, to ensure the user has two buttons, yes or no, if the user presses the yes, the row is removed , And it's working fine. However, my problem is that when the user chooses no, I am unable to return the table cell speed to the normal, original state, which shows the hiding button hidden. My problem is that I do not press the line on the user's warning, and after doing the animation, I want to do this, as if the user had swipe it initially.

I have the following code:

  - Cancel (void) Delete {//[self.tableViewReloadData}; // NSLog (@ "IndexPath:% @", self.myIndexPath); //reself.tableView unselectDragPath: self MyMindPath Animated: Yes]; [Self.tableView reloadRowsAtIndexPaths: @ [self.deletedRowIndexPath] withRowAnimation: UITableViewRowAnimationRight]; }   

I have left the lines of comments in the place you have to show / use what I have used.

[self.tableView reloadData] returns the cell back to the original state, but there is no sliding animation of the right cell, as if it is a gradually removed button Hides. [self.tableView reloadRowsAtIndexPaths: @ [self.myIndexPath] withRowAnimation: UITableViewRowAnimationRight] What works closely, but unfortunately, it shocks to the left, and then the cell to slide to the right I do not want this initial shock movement, I honestly thought that [self.tableView deselectRowAtIndexPath: self.myIndexPath animated: yes] will work, but unfortunately, it's nothing when It does not have to be called. Can anyone see what I am doing wrong?

Everyone who replies, thank you in advance.

Reloading is a completely wrong strategy (as you've found). By swiping to remove, the table view cell has been inserted in the edit mode, what you want to do is put it back again so that it is not in edit mode .

There are several ways to do this: You may be able to call tableView: commitEditingStyle: forRowAtIndexPath: . You may be able to call setEditing: animated: . In any case, leave your concentration on the reload (which is about data ) and start experimenting with the editing mode.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -