GithubHelp home page GithubHelp logo

isabella232 / fmmovetableview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sumi-interactive/fmmovetableview

0.0 0.0 0.0 92 KB

An iOS UITableView subclass that allows you to move rows without being in edit mode simply by tapping and holding the appropriate row.

Ruby 1.92% Objective-C 98.08%

fmmovetableview's Introduction

FMMoveTable

FMMoveTable is an UITableView subclass that provides moving rows by simply tap and hold an appropriate row without switching the table to it's edit mode.

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 details

Background

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.

Take care. Florian

Web: http://blog.madeFM.com Twitter: http://twitter.com/FlorianMielke

License and Warranty

Available under the terms of a BSD-style open source license.

Copyright © 2012, Florian Mielke. All rights reserved.

This software is supplied to you by Florian Mielke in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this software.

In consideration of your agreement to abide by the following terms, and subject to these terms, Florian Mielke grants you a personal, non-exclusive license, to use, reproduce, modify and redistribute the software, with or without modifications, in source and/or binary forms; provided that if you redistribute the software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the software, and that in all cases attribution of Florian Mielke as the original author of the source code shall be included in all such resulting software products or distributions.

Neither the name, trademarks, service marks or logos of Florian Mielke may be used to endorse or promote products derived from the software without specific prior written permission from Florian Mielke. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Florian Mielke herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the software may be incorporated.

The software is provided by Florian Mielke on an "AS IS" basis. FLORIAN MIELKE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.

IN NO EVENT SHALL FLORIAN MIELKE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF FLORIAN MIELKE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

fmmovetableview's People

Contributors

kyoji2 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.