Last active
November 11, 2017 17:27
-
-
Save pgpt10/abef33ddd07bfa5140e1af53bc96c7f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
collectionView.performBatchUpdates({ | |
var indexPaths = [IndexPath]() | |
for (index, item) in coordinator.items.enumerated() | |
{ | |
//Destination index path for each item is calculated separately using the destinationIndexPath fetched from the coordinator | |
let indexPath = IndexPath(row: destinationIndexPath.row + index, section: destinationIndexPath.section) | |
self.items.insert(item.dragItem.localObject as! String, at: indexPath.row) | |
indexPaths.append(indexPath) | |
} | |
collectionView.insertItems(at: indexPaths) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment