Created
November 10, 2017 10:59
-
-
Save pgpt10/ed4f57caffcbb9def81e439a8cc4b729 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
func collectionView(_ collectionView: UICollectionView, dropSessionDidUpdate session: UIDropSession, withDestinationIndexPath destinationIndexPath: IndexPath?) -> UICollectionViewDropProposal | |
{ | |
if session.localDragSession != nil | |
{ | |
if collectionView.hasActiveDrag | |
{ | |
return UICollectionViewDropProposal(operation: .move, intent: .insertAtDestinationIndexPath) | |
} | |
else | |
{ | |
return UICollectionViewDropProposal(operation: .copy, intent: .insertAtDestinationIndexPath) | |
} | |
} | |
else | |
{ | |
return UICollectionViewDropProposal(operation: .forbidden) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment