Skip to content

Instantly share code, notes, and snippets.

@pgpt10
Created November 10, 2017 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgpt10/c63a02b27b0807d4b0e9d3fe672cf3b0 to your computer and use it in GitHub Desktop.
Save pgpt10/c63a02b27b0807d4b0e9d3fe672cf3b0 to your computer and use it in GitHub Desktop.
func collectionView(_ collectionView: UICollectionView, itemsForAddingTo session: UIDragSession, at indexPath: IndexPath, point: CGPoint) -> [UIDragItem]
{
let item = self.items[indexPath.row]
let itemProvider = NSItemProvider(object: item as NSString)
let dragItem = UIDragItem(itemProvider: itemProvider)
dragItem.localObject = item
return [dragItem]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment