Latest 0.2
Homepage https://github.com/hpique/HPReorderTableView
License Apache 2.0
Platforms ios 6.1, requires ARC
Authors

Version Platform Build Status

Drop-in UITableView replacement to reorder cells with long press on any part of the cell.

Reordering animation

Installation

Using CocoaPods:

pod 'HPReorderTableView', '~> 0.2'

Or add the files from the HPReorderTableView directory if you’re doing it manually.

Usage

Simply instance HPReorderTableView instead of UITableView:

UITableView *tableView = [[HPReorderTableView alloc] init];

Or if you’re using interface builder, change the class of the table view to HPReorderTableView.

Then implement the reordering methods of your table view data source as you would normally do if you were using the default reorder behavior. For example:

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath
{
    [_objects exchangeObjectAtIndex:sourceIndexPath.row withObjectAtIndex:destinationIndexPath.row];
}

Customization

See the documentation for customization options.

Requirements

HPReorderTableView requires iOS 6.1 or above and ARC.

License

Copyright 2014 Hermes Pique (@hpique)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Uses code from BVReorderTableView by bvogelzang.

Latest podspec

{
    "name": "HPReorderTableView",
    "version": "0.2",
    "summary": "Drop-in UITableView replacement to reorder cells with long press on any part of the cell.",
    "screenshots": "https://raw.githubusercontent.com/hpique/HPReorderTableView/master/Assets/screenshot.png",
    "homepage": "https://github.com/hpique/HPReorderTableView",
    "license": {
        "type": "Apache 2.0",
        "file": "LICENSE"
    },
    "authors": {
        "Hermes Pique": "@hpique"
    },
    "social_media_url": "https://twitter.com/hpique",
    "platforms": {
        "ios": "6.1"
    },
    "source": {
        "git": "https://github.com/hpique/HPReorderTableView.git",
        "tag": "v0.2"
    },
    "source_files": "HPReorderTableView/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This