Latest 1.0.0
License MIT
Platforms ios 8.0

CI Status

What is this?

LongPressTableViewReordering is a Swift library that lets users long
press to reorder cells in a table view. It is a Swift adaption of this
original Objective-C approach, posted on March 24, 2014:

Read the original post

I will add more features to this lib if I need more in my own projects.

How does it work?

To add long press reorder functionality to a table view, make the data
source implement LongPressTableViewReorderer, then do the following:

First, the protocol requires two backing fields. Just declare them and
leave them without initial values. You will never use these properties
yourself, but the reorderer will use them under the hood.

Now you can call enableLongPressReorderingForTableView to let a user
reorder cells with a long press. Since a protocol extension cannot set
target actions, you must inject a gesture listener that is responsible
to call longPressReorderGestureChanged from your class.

If you know a better way to achieve the same result, feel free to help.

Example Project

The example project is currently empty. I will add a reorderable table
view whenever I manage to find some time in this crazy world of ours.



This lib is available through CocoaPods. Just
add the following line to your Podfile and run pod install to add it
to your project.

pod "LongPressTableViewReordering"


Versions < 1.0.0 will have breaking changes between minor versions, so
LongPressTableViewReordering 0.3.0 may not be compatible with 0.2.0.


Daniel Saidi, [email protected]


LongPressTableViewReordering is available under the MIT license.
See the LICENSE file for more info.

Latest podspec

    "name": "LongPressTableViewReordering",
    "version": "1.0.0",
    "summary": "LongPressTableViewReordering lets you long press to reorder table view cells.",
    "description": "LongPressTableViewReordering is a library that makes it easynto let users long press to reorder cells in a table view. Tonuse it, implement the `LongPressTableViewReorderer` protocolninstead of `UITableViewDataSource` and use it as data source.nThis will automatically enable long press to reorder.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Daniel Saidi": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0.0"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "source_files": "LongPressTableViewReordering/Classes/**/*",
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This