Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/FlorianMielke/FMMoveTableView
Discontinued: Please use iOS 11's Drag & Drop capability instead.
https://github.com/FlorianMielke/FMMoveTableView
Last synced: 3 months ago
JSON representation
Discontinued: Please use iOS 11's Drag & Drop capability instead.
- Host: GitHub
- URL: https://github.com/FlorianMielke/FMMoveTableView
- Owner: FlorianMielke
- License: mit
- Archived: true
- Created: 2012-03-27T15:06:47.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2018-03-07T09:49:02.000Z (almost 7 years ago)
- Last Synced: 2024-10-15T04:07:43.213Z (3 months ago)
- Language: Objective-C
- Homepage:
- Size: 235 KB
- Stars: 623
- Watchers: 26
- Forks: 101
- Open Issues: 2
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
- awesome - FMMoveTableView - Discontinued: Please use iOS 11's Drag & Drop capability instead. (etc)
- awesome - FMMoveTableView - Discontinued: Please use iOS 11's Drag & Drop capability instead. (etc)
README
Discontinued
------------iOS 11 introduced Drag & Drop capability for `UITableView` and `UICollectionView`. Please use that instead of `FMMoveTable`.
FMMoveTable
=======================`FMMoveTable` is an `UITableView` subclass that provides moving rows by simply tap and hold an appropriate row *without* switching the table to its edit mode.
![](Sample.gif)
Donations
---------I wrote FMMoveTable for use in one of my own apps and think that it could be quite useful (and very time-saving) for others.
If you find it helpful, a Paypal donation would be very appreciated (donation [at] madeFM [dot] com).
How to use
----------1. Import the `QuartzCore` framework.
2. Add FMMoveTableView.(h/m) and FMMoveTableViewCell.(h/m) to your project
3. Change you `UITableView` subclass to be a subclass of `FMMoveTableView`
4. Change your `UITableViewCell` subclass to be a subclass of `FMMoveTableViewCell`
5. Update your `UI(Table)ViewController` to conform to `FMMoveTableViewDataSource` and (optional) `FMMoveTableViewDelegate`
6. Implement at least the delegate method `moveTableView:moveRowFromIndexPath:toIndexPath:` to update your model after a move
7. Implement some additional checked in your table view data source / delegate. Check the `FMMoveViewController`for further detailsBackground
----------**FMMoveTableView**
Addopts the known `UITableViewDataSource` and `UITableViewDelegate` methods to check whether a row:
* **Will move:** `moveTableView:willMoveRowAtIndexPath:`
* **Can be moved:** `moveTableView:canMoveRowAtIndexPath:`
* **Can move to an index path:** `moveTableView:targetIndexPathForMoveFromRowAtIndexPath:toProposedIndexPath:`
* **Did move:** `moveTableView:moveRowFromIndexPath:toIndexPath:`***
**FMMoveTableViewCell**
Uses a method `prepareForMove` that you may need to overwrite if you use a custom subclass.
In it's basic implementation it resets the `textLabel`, `detailTextLabel` and `imageView`.
Contact
-------I can't answer any questions about how to use the code, but I'd love to read any emails telling me that you're using it, creating an app with it, or just saying thanks.
> -- Florian
Twitter: [@FlorianMielke](http://twitter.com/FlorianMielke)