This is a follow-up to How to get notified when a tableViewController finishes animating the push onto a nav stack.
In a tableView
I want to deselect a row with animation, but only after the tableView has finished animating the scroll to the selected row. How can I be notified when that happens, or what method gets called the moment that finishes.
This is the order of things:
- Push view controller
- In
viewWillAppear
I select a certain row.
- In
viewDidAppear
I scrollToRowAtIndexPath
(to the selected row).
- Then when that finishes scrolling I want to
deselectRowAtIndexPath: animated:YES
This way, the user will know why they were scrolled there, but then I can fade away the selection.
Step 4 is the part I haven't figured out yet. If I call it in viewDidAppear
then by the time the tableView scrolls there, the row has been deselected already which is no good.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…