All Projects → KevinZhouRafael → DragDropiOS

KevinZhouRafael / DragDropiOS

Licence: MIT license
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.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to DragDropiOS

react-native-dnd-board
A drag and drop Kanban board for React Native.
Stars: ✭ 41 (-42.25%)
Mutual labels:  drag-and-drop, drag, drop
Gong Wpf Dragdrop
The GongSolutions.WPF.DragDrop library is a drag'n'drop framework for WPF
Stars: ✭ 1,669 (+2250.7%)
Mutual labels:  drag-and-drop, drag, drop
KanbanDragDropiOS
Kanban Board using Drag & Drop iOS API
Stars: ✭ 95 (+33.8%)
Mutual labels:  drag-and-drop, drag, drop
Ng2 Dnd
Angular 2 Drag-and-Drop without dependencies
Stars: ✭ 861 (+1112.68%)
Mutual labels:  drag-and-drop, drag, drop
Angular Skyhook
An implementation of react-dnd for Angular.
Stars: ✭ 146 (+105.63%)
Mutual labels:  drag-and-drop, drag, drop
Kddraganddropcollectionview
This component allows for the transfer of data items between collection views through drag and drop
Stars: ✭ 476 (+570.42%)
Mutual labels:  drag-and-drop, drag, drop
React Smooth Dnd
react wrapper components for smooth-dnd
Stars: ✭ 1,560 (+2097.18%)
Mutual labels:  drag-and-drop, drag, drop
dockview
Zero dependency layout manager and builder with ReactJS support
Stars: ✭ 45 (-36.62%)
Mutual labels:  drag-and-drop, drag, drop
vue-simple-upload-component
A simple upload component for Vue.js 2.x
Stars: ✭ 14 (-80.28%)
Mutual labels:  drag-and-drop, drag, drop
rc-dock
Dock Layout for React Component
Stars: ✭ 318 (+347.89%)
Mutual labels:  drag-and-drop, drag, drop
drop
A LÖVE visualizer and music player
Stars: ✭ 17 (-76.06%)
Mutual labels:  drag-and-drop, drag, drop
Smooth Dnd
drag and drop library for javascript
Stars: ✭ 408 (+474.65%)
Mutual labels:  drag-and-drop, drag, drop
solid-dnd
A lightweight, performant, extensible drag and drop toolkit for Solid JS.
Stars: ✭ 251 (+253.52%)
Mutual labels:  drag-and-drop, drag, drop
Vue Smooth Dnd
Vue wrapper components for smooth-dnd
Stars: ✭ 1,121 (+1478.87%)
Mutual labels:  drag-and-drop, drag, drop
KDRearrangeableCollectionViewFlowLayout
A Drag and Rearrange UICollectionView through its layout
Stars: ✭ 73 (+2.82%)
Mutual labels:  drag-and-drop, drag, drop
image-uploader
Simple Drag & Drop image uploader plugin to static forms, without using AJAX
Stars: ✭ 70 (-1.41%)
Mutual labels:  drag-and-drop, drag, drop
Ngx Smooth Dnd
angular wrapper for smooth-dnd
Stars: ✭ 152 (+114.08%)
Mutual labels:  drag-and-drop, drag, drop
Sortable
Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.
Stars: ✭ 23,641 (+33197.18%)
Mutual labels:  drag-and-drop, drag
React Beautiful Dnd
Beautiful and accessible drag and drop for lists with React
Stars: ✭ 25,810 (+36252.11%)
Mutual labels:  drag-and-drop, drag
Silex
Silex is a static website builder in the cloud.
Stars: ✭ 958 (+1249.3%)
Mutual labels:  drag-and-drop, drag

DragDropiOS

Version Carthage compatible License Platform

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.

Example

The example shows a drag and drop demo betweens UICollectionView, UITableView and UIView.

To run the example project, clone the repo, and run pod install from the Example directory first.

Simple image

Requirements

  • iOS 8.0+
  • Xcode 10.2
  • Swift 5

Installation

Cocoapods

DragDropiOS is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "DragDropiOS"

Carthage

If you're using Carthage, you can add a dependency on DragDropiOS by adding it to your Cartfile:

github "KevinZhouRafael/DragDropiOS"

Introduce

Draggable

@objc public protocol Draggable:NSObjectProtocol {
    @objc optional func touchBeginAtPoint(_ point : CGPoint) -> Void
    
    func canDragAtPoint(_ point : CGPoint) -> Bool
    func representationImageAtPoint(_ point : CGPoint) -> UIView?
    func dragInfoAtPoint(_ point : CGPoint) -> AnyObject?
    func dragComplete(_ dragInfo:AnyObject,dropInfo : AnyObject?) -> Void
    
    @objc optional func stopDragging() -> Void
}

Dropable

@objc public protocol Droppable:NSObjectProtocol {
    func canDropWithDragInfo(_ dragInfo:AnyObject, inRect rect : CGRect) -> Bool
    func dropOverInfoInRect(_ rect:CGRect) -> AnyObject?
    @objc optional func dropOutside(_ dragInfo:AnyObject, inRect rect:CGRect)->Void
    func dropComplete(_ dragInfo : AnyObject,dropInfo:AnyObject?, atRect : CGRect) -> Void
    @objc optional func checkFroEdgesAndScroll(_ item : AnyObject, inRect rect : CGRect) -> Void
    @objc optional func stopDropping() -> Void
}

DragDropTableView and DragDropTableViewDelegate

@objc public protocol DragDropTableViewDelegate : NSObjectProtocol {
    
    @objc optional func tableView(_ tableView: UITableView, indexPathForDragInfo dragInfo: AnyObject) -> IndexPath?
    func tableView(_ tableView: UITableView, dragInfoForIndexPath indexPath: IndexPath) -> AnyObject
    @objc optional func tableView(_ tableView: UITableView, representationImageAtIndexPath indexPath: IndexPath) -> UIImage?
    
    
    //drag
    func tableView(_ tableView: UITableView, touchBeginAtIndexPath indexPath:IndexPath) -> Void
    func tableView(_ tableView: UITableView, canDragAtIndexPath indexPath: IndexPath) -> Bool
    
    func tableView(_ tableView: UITableView, dragCompleteWithDragInfo dragInfo:AnyObject, atDragIndexPath dragIndexPath: IndexPath,withDropInfo dropInfo:AnyObject?) -> Void
    func tableViewStopDragging(_ tableView: UITableView)->Void
    
    
    //drop
    func tableView(_ tableView: UITableView, canDropWithDragInfo info:AnyObject, AtIndexPath indexPath: IndexPath) -> Bool
    @objc optional func tableView(_ tableView: UITableView, dropOutsideWithDragInfo info:AnyObject) -> Void
    func tableView(_ tableView: UITableView, dropCompleteWithDragInfo dragInfo:AnyObject, atDragIndexPath dragIndexPath: IndexPath?,withDropInfo dropInfo:AnyObject?,atDropIndexPath dropIndexPath:IndexPath) -> Void
    func tableViewStopDropping(_ tableView: UITableView)->Void
    
}

DragDropCollectionView and DragDropCollectionViewDelegate

@objc public protocol DragDropCollectionViewDelegate : NSObjectProtocol {
    
    @objc optional func collectionView(_ collectionView: UICollectionView, indexPathForDragInfo dragInfo: AnyObject) -> IndexPath?
    func collectionView(_ collectionView: UICollectionView, dragInfoForIndexPath indexPath: IndexPath) -> AnyObject
    @objc optional func collectionView(_ collectionView: UICollectionView, representationImageAtIndexPath indexPath: IndexPath) -> UIImage?
    
    
    //drag
    func collectionView(_ collectionView: UICollectionView, touchBeginAtIndexPath indexPath:IndexPath) -> Void
    func collectionView(_ collectionView: UICollectionView, canDragAtIndexPath indexPath: IndexPath) -> Bool

    func collectionView(_ collectionView: UICollectionView, dragCompleteWithDragInfo dragInfo:AnyObject, atDragIndexPath dragIndexPath: IndexPath,withDropInfo dropInfo:AnyObject?) -> Void
    func collectionViewStopDragging(_ collectionView: UICollectionView)->Void
    
    
    //drop
    func collectionView(_ collectionView: UICollectionView, canDropWithDragInfo info:AnyObject, AtIndexPath indexPath: IndexPath) -> Bool
    @objc optional func collectionView(_ collectionView: UICollectionView, dropOutsideWithDragInfo info:AnyObject) -> Void
    func collectionView(_ collectionView: UICollectionView, dropCompleteWithDragInfo dragInfo:AnyObject, atDragIndexPath dragIndexPath: IndexPath?,withDropInfo dropInfo:AnyObject?,atDropIndexPath dropIndexPath:IndexPath) -> Void
    func collectionViewStopDropping(_ collectionView: UICollectionView)->Void
    
}

Useage

  • Just let the view implement the Dragable Interface, the view can drag from. If the view implement the Dropable Interface, the view can drop in.

  • If you want drag or drop cells with UITableView. please create child class of DragDropTableView, and implenment DragDropTableViewDelegate delegate.

  • If you want drag or drop cells with UICollectionView, please create child class of DragDropCollectionView, and implenment DragDropCollectionViewDelegate delegate.

  • 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.

Author

Rafael Zhou

License

DragDropiOS is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].