Giter Site home page Giter Site logo

digabriel / abmenutableviewcell Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexbumbu/abmenutableviewcell

0.0 2.0 0.0 1.86 MB

Highly customizable, yet simple to use, solution for UITableViewCell right menu, shown by ''swipe to delete' gesture.

License: MIT License

Ruby 3.61% Objective-C 96.39%

abmenutableviewcell's Introduction

ABMenuTableViewCell

Highly customizable, yet simple to use, solution for UITableViewCell right menu, shown by 'swipe to delete' gesture.

Mail App Styled Menu - show & hide example:

Without any extra work needed, showing the right menu view works with default swipe-to-delete gesture. Also, hiding the menu is done using known gestures like tapping or swiping back.

Screenshot

Mail App Styled Menu - delete item example:

Deleting rows is as simple as the default implementation.

Screenshot

Custom Styled Menu - show, hide & delete example

The advantage of using custom menus is that you're not stuck with Apple style buttons and you can easily integrate your own design.

Screenshot

Integration

  • Install via cocoapods (just add pod 'ABMenuTableViewCell', '~> 1.0' to your Podfile), or clone this repository and drag the content of ABMenuTableViewCell folder to your project.
  • To use you just need to replace UITableViewCell with ABMenuTableViewCell and assign your custom menu view to rightMenuView property and you're ready to go! You can take a look at the following snippet for details.
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *identifier = @"ABMenuTableViewCell";
    ABMenuTableViewCell *cell = (ABMenuTableViewCell*)[tableView cellForRowAtIndexPath:indexPath];

    if (!cell) {
        cell = [[ABMenuTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
    }
    
    // use your own custom menu view
    UIView *menuView = [[UIView alloc] initWithFrame:CGRectMake(.0, .0, 160.0, 44.0)];
    menuView.backgroundColor = [UIColor redColor];

    cell.rightMenuView = menuView;
    cell.textLabel.text = @"Lorem ipsum dolor sit amet";

    return cell;
}

Compatibility

  • iOS 7 and iOS 8

Credits

ABMenuTableViewCell was created by Alex Bumbu.

License

ABMenuTableViewCell is available under the MIT license. See the LICENSE file for more info. For usage without attribution contact Alex Bumbu.

abmenutableviewcell's People

Contributors

alexbumbu avatar digabriel avatar

Watchers

 avatar James Cloos 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.