Drag and drop between your apps in split view mode on iOS 9

Overview

SplitViewDragAndDrop

Easily add drag and drop to pass data between your apps

Platform Swift 3 Cocoapods Compatible

Setup

  • Add pod 'SplitViewDragAndDrop' to your Podfile or copy the "SplitViewDragAndDrop" folder into your project
  • Make sure to call SplitViewDragAndDrop.configure(groupIdentifier: <YOUR-APP-GROUP-ID>) in application:didFinishLaunchingWithOptions:. Your apps must share that app group in order to communicate.
  • Configure the view you want to drag with SplitViewDragAndDrop.handleDrag(viewToDrag: <THE-DRAGGABLE-VIEW>, identifier: <AN-IDENTIFIER>, dataToTransfer: <SOME-DATA-TO-TRANSFER>) where
    • viewToDrag is a UIView and it will be snapshotted and dragged around
    • identifier is a string rappresenting an unique identifier.
    • dataToTransfer is a Data, it could be an image, a pdf ecc..
  • Configure the drop observer with
    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
    • targetView is a UIView and it will be the center of the dragged item when the user end the dragging and the validation succedded
    • identifier is a string rappresenting an unique identifier
    • draggingBegan is a closure that will be called when the drag is began
    • draggingValidation is a closure that will be called when the drag is ended. You have to return a value that indicate if the drag is valid or not. If that value is true, the dragged view will be moved to the center of the targetView, otherwise it will be moved back to it's original position.
    • completion is a closure that will be called after the validation.

Demo

In this repository you can also find a demo.

Info

If you like this git you can follow me here or on twitter :) @MarioIannotta

Cheers from Italy!

You might also like...
Objective-C library for drag-n-drop of UITableViewCells in a navigation hierarchy of view controllers.
Objective-C library for drag-n-drop of UITableViewCells in a navigation hierarchy of view controllers.

ios-dragable-table-cells Support for drag-n-drop of UITableViewCells in a navigation hierarchy of view controllers. You drag cells by tapping and hold

FlutterNativeDragAndDrop - A package that allows you to add native drag and drop support into your flutter app
FlutterNativeDragAndDrop - A package that allows you to add native drag and drop support into your flutter app

native_drag_n_drop A package that allows you to add native drag and drop support

A robust drag-and-drop framework for iOS.

# BetweenKit ###Overview BetweenKit is a robust framework, built on UIKit that allows you to build drag-and-drop functionallity into your iOS applicat

Stock is a MacOS menu bar app that helps you quickly save a web link, a file link, or a text by using drag and drop
Stock is a MacOS menu bar app that helps you quickly save a web link, a file link, or a text by using drag and drop

Stock is a MacOS menu bar app that helps you quickly save a web link, a file link, or a text by using drag and drop

MacOS app which allows drag and drop of images to BLE thermal printers
MacOS app which allows drag and drop of images to BLE thermal printers

Print2BLE Copyright (c) 2021 BitBank Software, Inc. Written by Larry Bank [email protected] What is it? This project is a MacOS GUI applicatio

Easy UITableView drag-and-drop cell reordering
Easy UITableView drag-and-drop cell reordering

SwiftReorder NOTE: Some users have encountered compatibility issues when using this library with recent versions of iOS. For apps targeting iOS 11 and

A cells of UITableView can be rearranged by drag and drop.
A cells of UITableView can be rearranged by drag and drop.

TableViewDragger This is a demo that uses a TableViewDragger. Appetize's Demo Requirements Swift 4.2 iOS 8.0 or later How to Install TableViewDragger

Anchorage - Single file UIView drag and drop system
Anchorage - Single file UIView drag and drop system

anchorage Single file UIView drag and drop system anchors.mp4 License Copyright

A Drag-and-Drop library in pure SwiftUI.
A Drag-and-Drop library in pure SwiftUI.

SwiftUI Drag-and-Drop Drag-and-drop is an intuitive gesture and can improve the UX of an app. Chess Emoji Art Card Game To Do List Documentation Docum

CoreDragon is a drag'n'drop library for iOS applications
CoreDragon is a drag'n'drop library for iOS applications

CoreDragon is a drag'n'drop library for iOS applications. Instead of using context menus, modal view controllers, share sheets and other "indirect manipulation" ways of moving data around, it's much more intuitive to just grab the thing you want to move, and drop it on the place where you want to move it to.

Drag & drop to reorder items in SwiftUI.
Drag & drop to reorder items in SwiftUI.

SwiftUIReorderableForEach Easily implement drag & drop to reorder items in SwiftUI. This package contains a generic ReoderableForEach component, which

Taking a string containing a csv file and split it into records (aka lines) containing fields of data (aka Array of SubStrings)

Swift .csv parser Taking a string containing a csv file and split it into records (aka lines) containing fields of data (aka Array of SubStrings). Par

Tip-Calculation- - A program for calculate the tip. You can easily calculate it and you can split money easily
Tip-Calculation- - A program for calculate the tip. You can easily calculate it and you can split money easily

Tip-Calculation- It is a program for calculate the tip. You can easily calculate

A Swift sample code to reads ISO 10303-21 exchange structures (STEP P21 files for AP242) split into multiple files using external references approach.

multipleP21ReadsSample A Swift sample code to reads ISO 10303-21 exchange structures (STEP P21 files for AP242) split into multiple files using extern

We-split - A study app made using SwiftUI

We Split We Split is a study app made using SwiftUI, being part of 100 Days of S

SplitSheet - A lightweight, fully interactive split-screen sheet.
SplitSheet - A lightweight, fully interactive split-screen sheet.

SplitSheet A lightweight, fully interactive split-screen sheet. Powered by UIScrollView for super-smooth gestures. Show/hide either programmatically o

A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles
A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles

A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles while pushing or popping a view controller for all orientations. And you don't need to write any line of code for it, it all happens automatically.

A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles
A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles

A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles while pushing or popping a view controller for all orientations. And you don't need to write any line of code for it, it all happens automatically.

Drop in user input validation for your iOS apps.
Drop in user input validation for your iOS apps.

Validator Validator is a user input validation library written in Swift. It's comprehensive, designed for extension, and leaves the UI up to you. Here

Releases(0.1)
Owner
Mario Iannotta
Mobile Lead at @KeylessTech
Mario Iannotta
The easiest way to show off your iOS taps and gestures for demos and videos.

It's ShowTime ?? Installation Swift Package Manager Cocoapods Manual Usage How it works Useful info Author License ShowTime is the simplest and best w

Kane Cheshire 459 Dec 27, 2022
Peek and Pop with backwards-compatibility

PeekPop Peek and Pop is a great new iOS feature introduced with iPhone 6S and 6S+ that allows you to easily preview content using 3D touch. Sadly, alm

Roy Marmelstein 2k Dec 8, 2022
Gesture recognizer tool [Swift / iOS]

DBPathRecognizer Demo Installation Simply add the file DBPathRecognizer.swift to your project Basic usage Start by creating a new DBPathRecognizer ins

Didier Brun 1.2k Dec 18, 2022
A better way to handle gestures on iOS

Tactile is a safer and more idiomatic way to respond to gestures and control events. It lets you catch bugs at compile time and write more expressive

Damien 714 Dec 29, 2022
Special way to work with gestures in iOS

At a Glance Sensitive is a library that simplifies work with gestures in iOS. Forget about target/action pattern of primitive UIGestureRecognizer. Wit

Igor M. 550 Dec 29, 2022
Special way to work with gestures in iOS

At a Glance Sensitive is a library that simplifies work with gestures in iOS. Forget about target/action pattern of primitive UIGestureRecognizer. Wit

Igor M. 550 Dec 29, 2022
A Simple way help you drop or drag your source (like UIImage) between different App.

A Simple way help you drop or drag your source (like UIImage) between different App.

逸风 13 Nov 24, 2022
This component allows for the transfer of data items between collection views through drag and drop

Drag and Drop Collection Views Written for Swift 4.0, it is an implementation of Dragging and Dropping data across multiple UICollectionViews. Try it

Michael Michailidis 508 Dec 19, 2022
This component allows for the transfer of data items between collection views through drag and drop

Drag and Drop Collection Views Written for Swift 4.0, it is an implementation of Dragging and Dropping data across multiple UICollectionViews. Try it

Michael Michailidis 508 Dec 19, 2022
Calculate your tip and split the bill between any number of people

Calculate your tip and split the bill between any number of people

Tirupati Balan 6 Feb 9, 2022