Skip to content

Instantly share code, notes, and snippets.

@paul1893
Last active January 2, 2018 09:56
Show Gist options
  • Save paul1893/2b8ad4a34d4819656481c5c60e117bfe to your computer and use it in GitHub Desktop.
Save paul1893/2b8ad4a34d4819656481c5c60e117bfe to your computer and use it in GitHub Desktop.
func tableView(_ tableView: UITableView, itemsForAddingTo session: UIDragSession, at indexPath: IndexPath, point: CGPoint) -> [UIDragItem] {
// Return an empty array to handle the tap normally or array to add items already got from itemsForBeginning
let image = arrImg[indexPath.row]
let provider = NSItemProvider(object: image as NSItemProviderWriting)
let item = UIDragItem(itemProvider: provider)
item.localObject = image
return [item]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment