Drag and drop between your apps in split view mode on iOS 9
MIT License
Easily add drag and drop to pass data between your apps
pod 'SplitViewDragAndDrop'
to your Podfile or copy the "SplitViewDragAndDrop" folder into your projectSplitViewDragAndDrop.configure(groupIdentifier: <YOUR-APP-GROUP-ID>)
in application:didFinishLaunchingWithOptions:
. Your apps must share that app group in order to communicate.SplitViewDragAndDrop.handleDrag(viewToDrag: <THE-DRAGGABLE-VIEW>, identifier: <AN-IDENTIFIER>, dataToTransfer: <SOME-DATA-TO-TRANSFER>)
SplitViewDragAndDrop.addDropObserver(
targetView: <A-TARGET-VIEW>,
identifier: <AN-IDENTIFIER>,
draggingBegan: { frame, draggedViewSnapshotImage, dataTransfered in
// the drag is began, here you can perform some ui changes in order to tell the user where to drag the item
},
draggingValidation: { frame, draggedViewSnapshotImage, dataTransfered in
return <A-BOOL>
},
completion: { frame, draggedViewSnapshotImage, dataTransfered, isValid in
// the drag is complete and you can use dataTrasfered if you want
}
)
where
In this repository you can also find a demo.
If you like this git you can follow me here or on twitter :) @MarioIannotta
Cheers from Italy!