Last active
November 16, 2017 10:37
-
-
Save icanswiftabit/4cfdf78d834e1078df7f6803e0761659 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
for item in coordinator.items { | |
let placeholder = UICollectionViewDropPlaceholder(insertionIndexPath: destinationIndexPath, reuseIdentifier: PlaceholderCollectionCell.identifier) | |
let placeholderContext = coordinator.drop(item.dragItem, to: placeholder) | |
item.dragItem.itemProvider.loadObject(ofClass: Cat.self) { cat, error in | |
DispatchQueue.main.async { | |
placeholderContext.commitInsertion { insertionIndexPath in | |
self.viewModel.cats.insert(cat as! Cat, at: insertionIndexPath.row) | |
} | |
} | |
} | |
} | |
coordinator.session.progressIndicatorStyle = .none |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment