工作方式:
NSAnimationContext.currentContext().duration = 0.25indexPathChanges.map({collectionVIEw.animator().moveItemAtIndexPath(NSAnimationContext.currentContext().duration = 0.25collectionVIEw.performBatchUpdates( { indexPathChanges.map({self.collectionVIEw.moveItemAtIndexPath(.0,toIndexPath: .1)})collectionVIEw.animator().performBatchUpdates({<your animations>},completion handler:{finished in <your completion handler>}).0,toIndexPath: .1)}) // trIEd this as well - no luck // indexPathChanges.map({self.collectionVIEw.animator().moveItemAtIndexPath(.0,toIndexPath: .1)})},completionHandler: {(finished) in print("Finished: \(finished)")
performBatchUpdates版本(即时更改 – 无动画):
解决方法 试着这样说吧:换句话说,通过animator()代理传递它.
总结以上是内存溢出为你收集整理的swift – NSCollectionView performBatchUpdates不会对更改进行动画处理全部内容,希望文章能够帮你解决swift – NSCollectionView performBatchUpdates不会对更改进行动画处理所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)