GithubHelp home page GithubHelp logo

isabella232 / rpslidingmenu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robotsandpencils/rpslidingmenu

0.0 0.0 0.0 1.93 MB

A collection view menu in the style of UltraVisual.

License: MIT License

Objective-C 98.33% Ruby 1.67%

rpslidingmenu's Introduction

RPSlidingMenu

A collection view menu in the style of UltraVisual.

RPSlidingMenu animated GIF

Youtube Video

Installation

From CocoaPods

Add pod 'RPSlidingMenu' to your Podfile

Usage

(see sample Xcode project in /Demo)

Create a new file that inherits from RPSlidingMenuViewController

Override the following methods:

// return the number of menu items
- (NSInteger)numberOfItemsInSlidingMenu;
// set properties of the cell like the textLabel.text, detailLabel.text and backgroundImageView.image
- (void)customizeCell:(RPSlidingMenuCell *)slidingMenuCell forRow:(NSInteger)row;
// optionally to handle a menu item being tapped
- (void)slidingMenu:(RPSlidingMenuViewController *)slidingMenu didSelectItemAtRow:(NSInteger)row;

##Example of code in .m

- (NSInteger)numberOfItemsInSlidingMenu {
    return 10; // 10 menu items
}

- (void)customizeCell:(RPSlidingMenuCell *)slidingMenuCell forRow:(NSInteger)row {
    slidingMenuCell.textLabel.text = @"Some Title";
    slidingMenuCell.detailTextLabel.text = @"Some longer description that is like a subtitle!";
    slidingMenuCell.backgroundImageView.image = [UIImage imageNamed:@"some_image"];

}

- (void)slidingMenu:(RPSlidingMenuViewController *)slidingMenu didSelectItemAtRow:(NSInteger)row {
    // when a row is tapped do some action like go to another view controller
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Row Tapped"
                                                    message:[NSString stringWithFormat:@"Row %d tapped.", row]
                                                   delegate:nil
                                          cancelButtonTitle:@"OK"
                                          otherButtonTitles:nil];
    [alert show];
}

##Notes

  • In the demo I used images that were 320x210. They just need to be big enough to cover the cells size

Contact

Robots & Pencils Logo

Follow Robots & Pencils on Twitter (@robotsNpencils)

Maintainers

License

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

rpslidingmenu's People

Contributors

interstateone avatar irtemed88 avatar dompepin avatar sridvijay avatar stephengazzard 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.