How to get notified when scrollToRowAtIndexPath finishes animating

前端 未结 6 1871
梦如初夏
梦如初夏 2020-11-30 09:57

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

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 09:58

    You can use the table view delegate's scrollViewDidEndScrollingAnimation: method. This is because a UITableView is a subclass of UIScrollView and UITableViewDelegate conforms to UIScrollViewDelegate. In other words, a table view is a scroll view, and a table view delegate is also a scroll view delegate.

    So, create a scrollViewDidEndScrollingAnimation: method in your table view delegate and deselect the cell in that method. See the reference documentation for UIScrollViewDelegate for information on the scrollViewDidEndScrollingAnimation: method.

提交回复
热议问题