April 2015
Intermediate to advanced
556 pages
17h 47m
English
For some apps, the negotiation of what operation will occur when the user drops can be quite complicated. After all, the source advertises its willingness to participate in some kinds of operations through draggingSession(_:sourceOperationMaskForDraggingContext:). The user may also indicate preferences by holding down the Control, Option, or Command key. It is the job of the destination to determine what happens.
The dragging info object will do most of the work for you. It will get the source’s advertised operation mask and filter it, depending on what modifier keys the user holds down. To see this, implement draggingUpdated(_:) and log out the dragging info’s operation mask:
override func draggingUpdated(sender: ...