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 (發布於 )
用户参与
星數537
關注者數8
派生數56
提交數72
已啟用問題?
問題數12
打開的問題數3
拉請求數12
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?