TableViewDragger
  • October 6, 2023

This is a demo that uses a TableViewDragger.

Appetize’s Demo

Requirements


  • Swift 5.0
  • iOS 11.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.

GitHub


View Github

#drag #indexpath #ios #swift #uitableview
YOU MIGHT ALSO LIKE...
SwiftSpeech

Recognize your user's voice elegantly without having to figure out authorization and audio engines. SwiftSpeech Examples Features Installation Getting Started ...

SwiftUIValueSlider

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

Sliders

Sliders is a compilation of all my stylable drag based SwiftUI components. It provides a variety of unique controls as well ...

SlidingRuler

SlidingRuler is a Swift package containing a SwiftUI control that acts like an linear infinite slider or a finite, more precise ...

Skeletonui

SkeletonUI aims to bring an elegant, declarative syntax to skeleton loading animations. Get rid of loading screens or spinners and ...