A cells of UITableView can be rearranged by drag and drop.
This is a demo that uses a TableViewDragger
.
Add the following to your Podfile
:
pod "TableViewDragger"
Add the following to your Cartfile
:
github "KyoheiG3/TableViewDragger"
weak var delegate: TableViewDraggerDelegate?
TableViewDragger
.weak var dataSource: TableViewDraggerDataSource?
TableViewDragger
.var isHiddenOriginCell: Bool
true
if want to hide the original cell.true
.var zoomScaleForCell: CGFloat
1
.var alphaForCell: CGFloat
1
.var opacityForShadowOfCell: Float
0.4
.var scrollVelocity: CGFloat
1
.init(tableView: UITableView)
UITableView
want to drag.optional func dragger(_ dragger: TableViewDragger, cellForRowAt indexPath: IndexPath) -> UIView?
optional func dragger(_ dragger: TableViewDragger, indexPathForDragAt indexPath: IndexPath) -> IndexPath
func dragger(_ dragger: TableViewDragger, moveDraggingAt indexPath: IndexPath, newIndexPath: IndexPath) -> Bool
true
. require a call to moveRowAtIndexPath:toIndexPath:
of UITableView and rearranged of data.optional func dragger(_ dragger: TableViewDragger, shouldDragAt indexPath: IndexPath) -> Bool
true
.Follow me 🎉
Under the MIT license. See LICENSE file for details.