{"id":17127554,"url":"https://github.com/marioiannotta/splitviewdraganddrop","last_synced_at":"2025-03-27T00:13:33.534Z","repository":{"id":62455873,"uuid":"93171199","full_name":"MarioIannotta/SplitViewDragAndDrop","owner":"MarioIannotta","description":"Drag and drop between your apps in split view mode on iOS 9","archived":false,"fork":false,"pushed_at":"2017-06-03T08:25:30.000Z","size":2074,"stargazers_count":332,"open_issues_count":0,"forks_count":21,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-17T12:08:56.764Z","etag":null,"topics":["drag-and-drop","ipad","multitasking","split-view","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarioIannotta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-02T14:02:51.000Z","updated_at":"2024-12-03T09:28:04.000Z","dependencies_parsed_at":"2022-11-01T23:03:51.700Z","dependency_job_id":null,"html_url":"https://github.com/MarioIannotta/SplitViewDragAndDrop","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarioIannotta%2FSplitViewDragAndDrop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarioIannotta%2FSplitViewDragAndDrop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarioIannotta%2FSplitViewDragAndDrop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarioIannotta%2FSplitViewDragAndDrop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarioIannotta","download_url":"https://codeload.github.com/MarioIannotta/SplitViewDragAndDrop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245755682,"owners_count":20667027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drag-and-drop","ipad","multitasking","split-view","swift"],"created_at":"2024-10-14T19:04:53.260Z","updated_at":"2025-03-27T00:13:33.516Z","avatar_url":"https://github.com/MarioIannotta.png","language":"Swift","readme":"# SplitViewDragAndDrop\nEasily add drag and drop to pass data between your apps\n\n[![Platform](http://img.shields.io/badge/platform-ios-red.svg?style=flat\n)](https://developer.apple.com/iphone/index.action)\n[![Swift 3](https://img.shields.io/badge/Swift-3-orange.svg?style=flat)](https://developer.apple.com/swift/) \n[![Cocoapods Compatible](https://img.shields.io/cocoapods/v/SplitViewDragAndDrop.svg)](https://img.shields.io/cocoapods/v/SplitViewDragAndDrop.svg)\n\n\u003cimg src=\"demo.gif\" height=\"500\"/\u003e\n\n# Setup\n- Add ```pod 'SplitViewDragAndDrop'``` to your Podfile or copy the \"SplitViewDragAndDrop\" folder into your project\n- Make sure to call \n```SplitViewDragAndDrop.configure(groupIdentifier: \u003cYOUR-APP-GROUP-ID\u003e)``` in ```application:didFinishLaunchingWithOptions:```. **Your apps must share that app group in order to communicate**.\n- Configure the view you want to drag with ```SplitViewDragAndDrop.handleDrag(viewToDrag: \u003cTHE-DRAGGABLE-VIEW\u003e, identifier: \u003cAN-IDENTIFIER\u003e, dataToTransfer: \u003cSOME-DATA-TO-TRANSFER\u003e)``` \n  where \n  - **viewToDrag** is a UIView and it will be snapshotted and dragged around\n  - **identifier** is a string rappresenting an unique identifier.\n  - **dataToTransfer** is a Data, it could be an image, a pdf ecc..\n - Configure the drop observer with  \n   ```\n   SplitViewDragAndDrop.addDropObserver(\n    targetView: \u003cA-TARGET-VIEW\u003e,\n    identifier: \u003cAN-IDENTIFIER\u003e,\n    draggingBegan: { frame, draggedViewSnapshotImage, dataTransfered in\n      // the drag is began, here you can perform some ui changes in order to tell the user where to drag the item\n    },\n    draggingValidation: { frame, draggedViewSnapshotImage, dataTransfered in            \n      return \u003cA-BOOL\u003e\n    },\n    completion: { frame, draggedViewSnapshotImage, dataTransfered, isValid in\n      // the drag is complete and you can use dataTrasfered if you want\n    }\n   )\n   ```\n    where \n    - **targetView** is a UIView and it will be the center of the dragged item when the user end the dragging and the validation succedded\n    - **identifier** is a string rappresenting an unique identifier\n    - **draggingBegan** is a closure that will be called when the drag is began\n    - **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.\n    - **completion** is a closure that will be called after the validation.\n     \n# Demo\nIn this repository you can also find a demo.\n\n# Info\nIf you like this git you can follow me here or on twitter :) [@MarioIannotta](http://www.twitter.com/marioiannotta)\n\nCheers from Italy!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarioiannotta%2Fsplitviewdraganddrop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarioiannotta%2Fsplitviewdraganddrop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarioiannotta%2Fsplitviewdraganddrop/lists"}