Latest1.0.3
Homepagehttps://github.com/RobotsAndPencils/RPSlidingMenu
LicenseMIT
Platformsios 6.0, requires ARC
Authors

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 320×210. 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.

Latest podspec

{
    "name": "RPSlidingMenu",
    "version": "1.0.3",
    "summary": "A collection view menu in the style of UltraVisual",
    "authors": {
        "Paul Thorsteinson": "[email protected]"
    },
    "homepage": "https://github.com/RobotsAndPencils/RPSlidingMenu",
    "source": {
        "git": "https://github.com/RobotsAndPencils/RPSlidingMenu.git",
        "tag": "1.0.3"
    },
    "source_files": "RPSlidingMenu/*.{h,m}",
    "license": "MIT",
    "platforms": {
        "ios": "6.0"
    },
    "requires_arc": true
}

Pin It on Pinterest

Share This