{"id":15038593,"url":"https://github.com/kevinzhourafael/dragdropios","last_synced_at":"2025-06-30T16:33:17.374Z","repository":{"id":51327915,"uuid":"72091581","full_name":"KevinZhouRafael/DragDropiOS","owner":"KevinZhouRafael","description":"DragDropiOS is a drag and drop manager on iOS.  It supports drag and drop with in one or more classes extends UIView. This library contains  UICollectionView and UITableView that implenment of drag and drop manager.","archived":false,"fork":false,"pushed_at":"2023-03-06T01:39:21.000Z","size":4260,"stargazers_count":83,"open_issues_count":4,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T23:54:03.248Z","etag":null,"topics":["drag","drag-and-drop","drag-drop-manager","drag-drop-swift","drag-drop-uitableview","dragdraoptableview","dragdropcollectionview","drop","drop-manager","ios","ios-drag-drop","swift","uicollectionview-implenment"],"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/KevinZhouRafael.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-27T09:15:07.000Z","updated_at":"2025-02-13T06:58:49.000Z","dependencies_parsed_at":"2024-06-21T13:13:38.536Z","dependency_job_id":"0cf6c5db-f9c3-41bf-9050-04d5dca45ffc","html_url":"https://github.com/KevinZhouRafael/DragDropiOS","commit_stats":{"total_commits":29,"total_committers":6,"mean_commits":4.833333333333333,"dds":"0.31034482758620685","last_synced_commit":"97f27c9f7777a62fb836f3e20217acf980a80eb9"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KevinZhouRafael%2FDragDropiOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KevinZhouRafael%2FDragDropiOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KevinZhouRafael%2FDragDropiOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KevinZhouRafael%2FDragDropiOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KevinZhouRafael","download_url":"https://codeload.github.com/KevinZhouRafael/DragDropiOS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131452,"owners_count":21052819,"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","drag-and-drop","drag-drop-manager","drag-drop-swift","drag-drop-uitableview","dragdraoptableview","dragdropcollectionview","drop","drop-manager","ios","ios-drag-drop","swift","uicollectionview-implenment"],"created_at":"2024-09-24T20:39:06.648Z","updated_at":"2025-04-09T23:54:09.164Z","avatar_url":"https://github.com/KevinZhouRafael.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DragDropiOS\n\n\n[![Version](https://img.shields.io/cocoapods/v/DragDropiOS.svg?style=flat)](http://cocoapods.org/pods/DragDropiOS)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/ActiveSQLite)\n[![License](https://img.shields.io/cocoapods/l/DragDropiOS.svg?style=flat)](http://cocoapods.org/pods/DragDropiOS)\n[![Platform](https://img.shields.io/cocoapods/p/DragDropiOS.svg?style=flat)](http://cocoapods.org/pods/DragDropiOS)\n\nDragDropiOS is a drag and drop manager on iOS. \nIt supports drag and drop with in one or more classes extends UIView.\nThis library contains  UICollectionView and UITableView that implenment of drag and drop manager.\n\n\n\n## Example\n\nThe example shows a drag and drop demo betweens UICollectionView, UITableView and UIView.\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n![Simple image](https://raw.githubusercontent.com/KevinZhouRafael/DragDropiOS/master/dragdropdemo.gif)\n\n\n## Requirements\n\n- iOS 8.0+  \n- Xcode 10.2\n- Swift 5\n\n## Installation\n\n### Cocoapods\n\nDragDropiOS is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"DragDropiOS\"\n```\n### Carthage\n\nIf you're using [Carthage](https://github.com/Carthage/Carthage), you can add a dependency on DragDropiOS by adding it to your Cartfile:\n\n```ruby\ngithub \"KevinZhouRafael/DragDropiOS\"\n```\n\n\n## Introduce\n\n### Draggable\n\n```swift\n@objc public protocol Draggable:NSObjectProtocol {\n    @objc optional func touchBeginAtPoint(_ point : CGPoint) -\u003e Void\n    \n    func canDragAtPoint(_ point : CGPoint) -\u003e Bool\n    func representationImageAtPoint(_ point : CGPoint) -\u003e UIView?\n    func dragInfoAtPoint(_ point : CGPoint) -\u003e AnyObject?\n    func dragComplete(_ dragInfo:AnyObject,dropInfo : AnyObject?) -\u003e Void\n    \n    @objc optional func stopDragging() -\u003e Void\n}\n```\n\n### Dropable\n\n```swift\n@objc public protocol Droppable:NSObjectProtocol {\n    func canDropWithDragInfo(_ dragInfo:AnyObject, inRect rect : CGRect) -\u003e Bool\n    func dropOverInfoInRect(_ rect:CGRect) -\u003e AnyObject?\n    @objc optional func dropOutside(_ dragInfo:AnyObject, inRect rect:CGRect)-\u003eVoid\n    func dropComplete(_ dragInfo : AnyObject,dropInfo:AnyObject?, atRect : CGRect) -\u003e Void\n    @objc optional func checkFroEdgesAndScroll(_ item : AnyObject, inRect rect : CGRect) -\u003e Void\n    @objc optional func stopDropping() -\u003e Void\n}\n```\n### DragDropTableView and DragDropTableViewDelegate\n\n```swift\n@objc public protocol DragDropTableViewDelegate : NSObjectProtocol {\n    \n    @objc optional func tableView(_ tableView: UITableView, indexPathForDragInfo dragInfo: AnyObject) -\u003e IndexPath?\n    func tableView(_ tableView: UITableView, dragInfoForIndexPath indexPath: IndexPath) -\u003e AnyObject\n    @objc optional func tableView(_ tableView: UITableView, representationImageAtIndexPath indexPath: IndexPath) -\u003e UIImage?\n    \n    \n    //drag\n    func tableView(_ tableView: UITableView, touchBeginAtIndexPath indexPath:IndexPath) -\u003e Void\n    func tableView(_ tableView: UITableView, canDragAtIndexPath indexPath: IndexPath) -\u003e Bool\n    \n    func tableView(_ tableView: UITableView, dragCompleteWithDragInfo dragInfo:AnyObject, atDragIndexPath dragIndexPath: IndexPath,withDropInfo dropInfo:AnyObject?) -\u003e Void\n    func tableViewStopDragging(_ tableView: UITableView)-\u003eVoid\n    \n    \n    //drop\n    func tableView(_ tableView: UITableView, canDropWithDragInfo info:AnyObject, AtIndexPath indexPath: IndexPath) -\u003e Bool\n    @objc optional func tableView(_ tableView: UITableView, dropOutsideWithDragInfo info:AnyObject) -\u003e Void\n    func tableView(_ tableView: UITableView, dropCompleteWithDragInfo dragInfo:AnyObject, atDragIndexPath dragIndexPath: IndexPath?,withDropInfo dropInfo:AnyObject?,atDropIndexPath dropIndexPath:IndexPath) -\u003e Void\n    func tableViewStopDropping(_ tableView: UITableView)-\u003eVoid\n    \n}\n```\n\n### DragDropCollectionView and DragDropCollectionViewDelegate\n```swift\n@objc public protocol DragDropCollectionViewDelegate : NSObjectProtocol {\n    \n    @objc optional func collectionView(_ collectionView: UICollectionView, indexPathForDragInfo dragInfo: AnyObject) -\u003e IndexPath?\n    func collectionView(_ collectionView: UICollectionView, dragInfoForIndexPath indexPath: IndexPath) -\u003e AnyObject\n    @objc optional func collectionView(_ collectionView: UICollectionView, representationImageAtIndexPath indexPath: IndexPath) -\u003e UIImage?\n    \n    \n    //drag\n    func collectionView(_ collectionView: UICollectionView, touchBeginAtIndexPath indexPath:IndexPath) -\u003e Void\n    func collectionView(_ collectionView: UICollectionView, canDragAtIndexPath indexPath: IndexPath) -\u003e Bool\n\n    func collectionView(_ collectionView: UICollectionView, dragCompleteWithDragInfo dragInfo:AnyObject, atDragIndexPath dragIndexPath: IndexPath,withDropInfo dropInfo:AnyObject?) -\u003e Void\n    func collectionViewStopDragging(_ collectionView: UICollectionView)-\u003eVoid\n    \n    \n    //drop\n    func collectionView(_ collectionView: UICollectionView, canDropWithDragInfo info:AnyObject, AtIndexPath indexPath: IndexPath) -\u003e Bool\n    @objc optional func collectionView(_ collectionView: UICollectionView, dropOutsideWithDragInfo info:AnyObject) -\u003e Void\n    func collectionView(_ collectionView: UICollectionView, dropCompleteWithDragInfo dragInfo:AnyObject, atDragIndexPath dragIndexPath: IndexPath?,withDropInfo dropInfo:AnyObject?,atDropIndexPath dropIndexPath:IndexPath) -\u003e Void\n    func collectionViewStopDropping(_ collectionView: UICollectionView)-\u003eVoid\n    \n}\n```\n\n### Useage\n- Just let the view implement the Dragable Interface, the view can drag from.\nIf the view implement the Dropable Interface, the view can drop in.\n\n- If you want drag or drop cells with UITableView. please create child class of DragDropTableView, and implenment DragDropTableViewDelegate delegate.\n\n- If you want drag or drop cells with UICollectionView, please create child class of DragDropCollectionView, and implenment DragDropCollectionViewDelegate delegate.\n\n- Before tableView or collectionView reloadData. you should cancel dragging process, please use DragDropiOS.cancelDragging(). The example support reloaddata every 5s, please use startTimer() method in Example.\n\n\n\n## Author\n\nRafael Zhou\n\n- Email me: \u003cwumingapie@gmail.com\u003e\n- Contact me on **Facebook**: [**wumingapie**](https://www.facebook.com/wumingapie)\n- Contact me on **Wechat\u0026QQ**: 358545592\n\n\n## License\n\nDragDropiOS is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinzhourafael%2Fdragdropios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinzhourafael%2Fdragdropios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinzhourafael%2Fdragdropios/lists"}