• Stars
    star
    536
  • Rank 82,794 (Top 2 %)
  • Language
    Swift
  • License
    MIT License
  • Created about 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

TableViewDragger

Carthage compatible Version License Platform

simpleimage

This is a demo that uses a TableViewDragger.

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.

Author

Kyohei Ito

Follow me πŸŽ‰

LICENSE

Under the MIT license. See LICENSE file for details.

More Repositories

1

DynamicBlurView

DynamicBlurView is a dynamic and high performance UIView subclass for Blur.
Swift
967
star
2

GridView

Reusable GridView with excellent performance and customization that can be time table, spreadsheet, paging and more.
Swift
855
star
3

AttributedLabel

Easy to use, fast, and higher performance than UILabel.
Swift
524
star
4

SimpleAlert

Customizable simple Alert and simple ActionSheet for Swift
Swift
398
star
5

PagingView

Infinite paging, Smart auto layout, Interface of similar to UIKit.
Swift
316
star
6

SpringIndicator

SpringIndicator is indicator and PullToRefresh. Inspired by Material design components.
Swift
272
star
7

Keynode

Interactive Keyboard Controller for Swift
Swift
77
star
8

NavigationNotice

Customizable and interactive animated notification UI control.
Swift
75
star
9

ProtobufExample

Example of requesting Protocol Buffers and JSON with Swift. API is Swift or Go.
Swift
67
star
10

Plan

The Plan.framework helps to keep your iOS application design clean.
Swift
36
star
11

RxDisplayLink

RxDisplayLink reactive wrapper for CADisplayLink
Swift
29
star
12

smooth_counter

Dart
24
star
13

Exclusion

Customizable URLCache.
Swift
19
star
14

MountainView

The animation curve looks like Mountain View.
Swift
14
star
15

G3JSON

Objective-C
11
star
16

gRPCExample

Swift
11
star
17

XcodeGenSample

Swift
9
star
18

InfiniteView

Swift
4
star
19

lcov_excluder

It is possible to exclude coverage by editing the contents of the lcov.info file.
Dart
3
star
20

grain

Module management library like requirejs.
JavaScript
2
star
21

CollectionViewGridLayout

How to use grid layout in UICollectionView.
Swift
2
star
22

assets

1
star