2016-04-26 10 views
6

Animasyonları tek tek yaptığımda her şey iyi çalışır, ancak performBatchUpdates bloğun içinde değişiklik anında anında, reloadData() olarak adlandırılır. Doğru kullanıyor muyum?NSCollectionView performBatchUpdates canlandırmada değişiklik yapmaz

Çalışma yöntemi:

NSAnimationContext.currentContext().duration = 0.25 

indexPathChanges.map({collectionView.animator().moveItemAtIndexPath($0.0, toIndexPath: $0.1)}) 

performBatchUpdates sürümü (anlık değişim - animasyon):

collectionView.animator().performBatchUpdates({<your animations>}, completion handler:{finished in <your completion handler>}) 

yılında:

NSAnimationContext.currentContext().duration = 0.25 

collectionView.performBatchUpdates( { 
    indexPathChanges.map({self.collectionView.moveItemAtIndexPath($0.0, toIndexPath: $0.1)}) 

    // tried this as well - no luck  
    // indexPathChanges.map({self.collectionView.animator().moveItemAtIndexPath($0.0, toIndexPath: $0.1)}) 

}, completionHandler: {(finished) in print("Finished: \(finished)") 

cevap

2

deneyin bu şekilde koymak diğer wo rds, animator() proxy'den geçirin.

İlgili konular