Last active
January 2, 2018 12:56
-
-
Save paul1893/9107ac57f7d2589ce51147c8cd7e4355 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 dropInteraction(_ interaction: UIDropInteraction, sessionDidUpdate session: UIDropSession) -> UIDropProposal { | |
| let dropLocation = session.location(in: view) | |
| let operation: UIDropOperation | |
| if selectedImageView.frame.contains(dropLocation) { | |
| if session.localDragSession == nil { // Drag come frome the app | |
| operation = .copy | |
| } else { // Drag come from a third app | |
| operation = .move | |
| } | |
| } else { | |
| operation = .cancel | |
| } | |
| return UIDropProposal(operation: operation) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment