This is a demo that uses a TableViewDragger.
- Swift 3.0
- iOS 7.0 or later
Add the following to your Podfile:
use_frameworks!
pod "TableViewDragger"Note: the use_frameworks! is required for pods made in Swift.
Add the following to your Cartfile:
github "KyoheiG3/TableViewDragger"Just add everything in the TableViewDragger.swift and TableViewDraggerCell.swift file to your project.
If target is ios8.0 or later, please import the TableViewDragger.
import TableViewDraggerweak var delegate: TableViewDraggerDelegate?- Delegate of
TableViewDragger.
weak var dataSource: TableViewDraggerDataSource?- DataSource of
TableViewDragger.
var originCellHidden: Bool- It will be
trueif want to hide the original cell. - Default is
true.
var cellZoomScale: CGFloat- Zoom scale of cell in drag.
- Default is
1.
var cellAlpha: CGFloat- Alpha of cell in drag.
- Default is
1.
var cellShadowOpacity: Float- Opacity of cell shadow in drag.
- Default is
0.4.
var scrollVelocity: CGFloat- Velocity of auto scroll in drag.
- Default is
1.
init(tableView: UITableView)UITableViewwant to drag.
optional func dragger(dragger: TableViewDragger.TableViewDragger, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell?- Return any cell if want to change the cell in drag.
optional func dragger(dragger: TableViewDragger.TableViewDragger, indexPathForDragAtIndexPath indexPath: NSIndexPath) -> NSIndexPath- Return the indexPath if want to change the indexPath to start drag.
func dragger(dragger: TableViewDragger.TableViewDragger, moveDraggingAtIndexPath indexPath: NSIndexPath, newIndexPath: NSIndexPath) -> Bool- If allow movement of cell, please return
true. require a call tomoveRowAtIndexPath:toIndexPath:of UITableView and rearranged of data.
optional func dragger(dragger: TableViewDragger.TableViewDragger, shouldDragAtIndexPath indexPath: NSIndexPath) -> Bool- If allow dragging of cell, prease return
true.
Under the MIT license. See LICENSE file for details.
