TableViewDragger

A cells of UITableView can be rearranged by drag and drop.

Github星跟踪图

TableViewDragger

Carthage compatible
Version
License
Platform

simpleimage

This is a demo that uses a TableViewDragger.

Appetize's Demo

Requirements

  • Swift 4.2
  • iOS 8.0 or later

How to Install TableViewDragger

CocoaPods

Add the following to your Podfile:

pod "TableViewDragger"

Carthage

Add the following to your Cartfile:

github "KyoheiG3/TableViewDragger"

Usage

TableViewDragger Variable

weak var delegate: TableViewDraggerDelegate?
  • Delegate of TableViewDragger.
weak var dataSource: TableViewDraggerDataSource?
  • DataSource of TableViewDragger.
var isHiddenOriginCell: Bool
  • It will be true if want to hide the original cell.
  • Default is true.
var zoomScaleForCell: CGFloat
  • Zoom scale of cell in drag.
  • Default is 1.
var alphaForCell: CGFloat
  • Alpha of cell in drag.
  • Default is 1.
var opacityForShadowOfCell: Float
  • Opacity of cell shadow in drag.
  • Default is 0.4.
var scrollVelocity: CGFloat
  • Velocity of auto scroll in drag.
  • Default is 1.

TableViewDragger Function

init(tableView: UITableView)
  • UITableView want to drag.

TableViewDraggerDataSource Function

optional func dragger(_ dragger: TableViewDragger, cellForRowAt indexPath: IndexPath) -> UIView?
  • Return any cell if want to change the cell in drag.
optional func dragger(_ dragger: TableViewDragger, indexPathForDragAt indexPath: IndexPath) -> IndexPath
  • Return the indexPath if want to change the indexPath to start drag.

TableViewDraggerDelegate Function

func dragger(_ dragger: TableViewDragger, moveDraggingAt indexPath: IndexPath, newIndexPath: IndexPath) -> Bool
  • If allow movement of cell, please return true. require a call to moveRowAtIndexPath:toIndexPath: of UITableView and rearranged of data.
optional func dragger(_ dragger: TableViewDragger, shouldDragAt indexPath: IndexPath) -> Bool
  • If allow dragging of cell, prease return true.

Author

Kyohei Ito

Follow me ?

LICENSE

Under the MIT license. See LICENSE file for details.

主要指标

概览
名称与所有者KyoheiG3/TableViewDragger
主编程语言Swift
编程语言Ruby (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2015-09-24 12:21:23
推送于2023-08-27 12:53:54
最后一次提交2023-08-27 21:53:34
发布数14
最新版本名称2.0.1 (发布于 )
第一版名称0.0.1 (发布于 )
用户参与
星数538
关注者数8
派生数57
提交数72
已启用问题?
问题数12
打开的问题数3
拉请求数12
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?