Skip to content

Menu View Controller. It has left, right and main view controllers. Supported tap and pan gestures. Supported storyboards

License

Notifications You must be signed in to change notification settings

vasily-popov/VPSlideMenu

Repository files navigation

VPSlideMenu

Menu View Controller. It has left, right and main view controllers. Supported tap and pan gestures. Supported storyboards

VPSlideMenu

Platform License

iOS Slide View

Installation

CocoaPods

pod 'VPSlideMenu'

Carthage

if iOS8 or later, Carthage is supported

  • Add github "vascome/VPSlideMenu" to your Cartfile.
  • Run carthage update.

for more info, see Carthage

Manually

Add the VPSlideMenu files to your project.

Usage

Setup

Add #import <VPSLideMenu/VPSlideMenu.h> in your file

Manual:

    UIStoryboard *sBoard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
    
    UIViewController *mainVC = [sBoard instantiateViewControllerWithIdentifier:@"MainVC"];
    LeftViewController *leftVC = (LeftViewController*)[sBoard instantiateViewControllerWithIdentifier:@"LeftVC"];
    UIViewController *rightVC = [sBoard instantiateViewControllerWithIdentifier:@"RightVC"];
    
    UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:mainVC];
    leftVC.mainViewController = nvc;
    
    VPSlideMenuViewController *slideMenuController = [[VPSlideMenuViewController alloc] initWithMainViewController:nvc leftViewController:leftVC rightViewController:rightVC];
    [slideMenuController setAutomaticallyAdjustsScrollViewInsets:YES];
    

    AppDelegate *app = (AppDelegate*)[[UIApplication sharedApplication] delegate];
    app.window.rootViewController = slideMenuController;

Storyboard Support

  1. put VPSlideMenuViewController in a storyboard.
  2. add left, right and main vc (see project example)
  • setup in code
VPSlideMenuViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateInitialViewController];
    AppDelegate *app = (AppDelegate*)[[UIApplication sharedApplication] delegate];
    ((LeftViewController*)vc.leftVC).mainViewController = vc.mainVC;
    app.window.rootViewController = vc;

You can access from UIViewController

[self slideMenuController]

add navigationBarButton

[self addLeftBarButtonWithImage:[UIImage imageNamed:@"left"]];
[self addrightBarButtonWithImage:[UIImage imageNamed:@"right"]];

License

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

About

Menu View Controller. It has left, right and main view controllers. Supported tap and pan gestures. Supported storyboards

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published