JPVerticalSlideMenu 1.0.1

JPVerticalSlideMenu 1.0.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.


Downloads

Total803
Week20
Month30

Installs

Apps26
Apps WeekApps This Week 1
Test Targets1
powered by Segment

GitHub

Stars8
Watchers1
Forks1
Issues0
Contributors1
Pull Requests2

Code

Files3
LOCLines of Code 428


  • By
  • Juanpe Catalán

Sliding Menu for iOS (Top and Bottom menus)

With this library you can create 3 types of sliding menus:
1. Slide menu with top menu only.
2. Slide menu with bottom menu only.
3. Slide menu with both top and bottom menus.

Intallation

Manual

Clone the repository:

$ git clone https://github.com/Juanpe/JPVerticalSlideMenu.git

Drag and drop JPVerticalSlideLib folder into your project. Add #import "JPVerticalSlideViewController.h" to all view controllers that need to use it.

Requirements

  • iOS 7.0 or higher
  • ARC

Sample Usage

In your AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    UIViewController* vcMain        = [[UIViewController alloc] init];
    vcMain.view.backgroundColor     = [UIColor blueColor];

    UIViewController * vcTop        = [[UIViewController alloc] init];
    vcTop.view.backgroundColor      = [UIColor redColor];

    UIViewController * vcBottom     = [[UIViewController alloc] init];
    vcBottom.view.backgroundColor   = [UIColor greenColor];

    JPVerticalSlideViewController* verticalSlideMenu = [JPVerticalSlideViewController verticalSlideMenuWithMainVC:vcMain
                                                                                                         andTopVC:vcTop
                                                                                                      andBottomVC:vcBottom];

    self.window.rootViewController  = verticalSlideMenu;


    self.window.backgroundColor     = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}

Customize

You can easily customize slide menu by overriding needed methods, such us:

- (CGFloat) topVCHeight;
- (CGFloat) bottomVCHeight;
- (CGFloat) panGestureWorkingAreaPercent;

You can open or close top or bottom menus programmatically:

- (void) openTopVC;
- (void) openTopVCAnimated:(BOOL)animated;
- (void) openBottomVC;
- (void) openBottomVCAnimated:(BOOL)animated;

- (void) closeTopVC;
- (void) closeTopVCAnimated:(BOOL)animated;
- (void) closeBottomVC;
- (void) closeBottomVCAnimated:(BOOL)animated;


If you want to get menu's open/close callbacks, you must implement protocol named JPVerticalSlideVCDelegate.

@optional
- (void) topVCWillOpen;
- (void) topVCDidOpen;
- (void) bottomVCWillOpen;
- (void) bottomVCDidOpen;

- (void) topVCWillClose;
- (void) topVCDidClose;
- (void) bottomVCWillClose;
- (void) bottomVCDidClose;