Reputation: 26506
A UITableViewCell
has a showingDeleteConfirmation
flag that you can read. As the name suggests, this allows you to know if the cell is showing the 'delete' button. There are two ways this delete button can be displayed:
I set up some logging to check the value of this flag in the cell's willTransitionToState:
. And I found something that confuses me.
In example (1), showingDeleteConfirmation
is YES
both when swiping across the row and when exiting editing for the cell (by touching outside the row after the swipe).
In example (2), showingDeleteConfirmation
is NO
when touching the '-' icon, but YES
when exiting editing for the cell (again by touching outside the row).
First, can someone confirm this is the case, and that it is not a quirk of my UITableViewCell
subclass.
Why would this be inconsistent? In my opinion behavior (2) is better, since it describes what is on screen at the time willTransitionToState:
is called.
Upvotes: 2
Views: 633
Reputation: 7416
Have you tried checking your logic in didTransitionToState:
instead? It seems to make sense that at the instance you tap the minus button it would be NO
and that later once the animation has finished it would change to YES
.
Upvotes: 1