Giter Site home page Giter Site logo

vascome / vpslidemenu Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 307 KB

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

License: MIT License

Objective-C 98.86% Ruby 1.14%
swipe-menu slide-menu menu

vpslidemenu's Introduction

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.

vpslidemenu's People

Contributors

vasily-popov avatar

Watchers

 avatar

vpslidemenu's Issues

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.