【发布时间】:2016-04-20 19:41:41
【问题描述】:
我有一个 UITableView,为此我使用新数据重新加载每一行:
for currentIndex in (feeds.count-1).stride(through: 0, by: -1) {
self.feedList[currentIndex] = feeds[currentIndex]
dispatch_async(dispatch_get_main_queue()) {
self.tableView.beginUpdates()
self.tableView.reloadRowsAtIndexPaths([NSIndexPath(forRow: currentIndex, inSection: 0)], withRowAnimation: UITableViewRowAnimation.Middle)
self.tableView.endUpdates()
}
}
这会使所有行同时动画化。我想要的是让每一行一个接一个地设置动画。我怎样才能做到这一点?
【问题讨论】:
-
您是否尝试过使用 CATransaction 并一次只为一行设置动画,并在 CATransaction 的完成块中调用下一行的动画?
标签: ios swift uitableview animation reload