Skip to content

Instantly share code, notes, and snippets.

@paul1893
Created January 2, 2018 12:54
Show Gist options
  • Save paul1893/9516816ecaa36adea083cf607d0cee05 to your computer and use it in GitHub Desktop.
Save paul1893/9516816ecaa36adea083cf607d0cee05 to your computer and use it in GitHub Desktop.
func dragInteraction(_ interaction: UIDragInteraction, itemsForBeginning session: UIDragSession) -> [UIDragItem] {
let image:UIImage = getImage()
let provider = NSItemProvider(object: image)
let item = UIDragItem(itemProvider: provider) // Build your drag item
item.localObject = image
return [item]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment