Git Product home page Git Product logo

apmultimenu's Introduction

APMultiMenu

Build Status Version License Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Left Menu Image Left Menu Landscape Image

Right Menu Image iPad Left Menu Landscape Image

How To Use

In AppDelegate.m:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    UINavigationController *nav = [sb instantiateViewControllerWithIdentifier:@"Nav"];
    UIViewController *leftVC = [sb instantiateViewControllerWithIdentifier:@"LeftVC"];
    UIViewController *rightVC = [sb instantiateViewControllerWithIdentifier:@"RightVC"];
    
    APMultiMenu *apmm = [[APMultiMenu alloc] initWithMainViewController:nav 
                                                               leftMenu:leftVC 
                                                              rightMenu:rightVC];
                                                          
    //Add Shadow To Main View
    apmm.mainViewShadowEnabled = YES;
    apmm.mainViewShadowColor = [UIColor blackColor]; //Default Value
    apmm.mainViewShadowRadius = 4.0f; //Default Value
    apmm.mainViewShadowOpacity = 0.8f; //Default Value
    apmm.mainViewShadowOffset = CGSizeMake(1, 1); //Default Value

    //Changing Animation Duration
    apmm.animationDuration = 0.4f; //Default Value

    self.window.rootViewController = apmm;
    [self.window makeKeyAndVisible];
    
    return YES;
}

To Change Main ViewController From the Slideout Menu:

//Option 1 - Plain ViewController
[self.sideMenuContainerViewController setMainViewController:(UIViewController *)]

//Option 2 - UINavgationController
[self.sideMenuContainerViewController setMainViewController:[[UINavigationController alloc] initWithRootViewController:(UIViewController *)]];

Using Delegate Methods

...
    apmm.delegate = self;
...

//Fired BEFORE one of the side menus open up
- (void)sideMenu:(APMultiMenu *)sideMenu willRevealSideMenu:(UIViewController *)sideMenuViewController {
    ...
}

//Fired BEFORE one of the side menus close
- (void)sideMenu:(APMultiMenu *)sideMenu willHideSideMenu:(UIViewController *)sideMenuViewController {
    ...
}

//Fired AFTER one of the side menus open up
- (void)sideMenu:(APMultiMenu *)sideMenu didRevealSideMenu:(UIViewController *)sideMenuViewController {
    ...
}

//Fired AFTER one of the side menus close
- (void)sideMenu:(APMultiMenu *)sideMenu didHideSideMenu:(UIViewController *)sideMenuViewController { 
    ...
}

Customization

The following properties are customizable:

  • mainViewShadowEnabled
  • mainViewShadowRadius
  • mainViewShadowOpacity
  • mainViewShadowOffset
  • mainViewShadowColor
  • animationDuration
  • menuIndentationEnabled
  • panGestureEnabled

Installation

APMultiMenu is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "APMultiMenu"

---OR---

You can clone the repo:

$ git clone https://github.com/Aadeshp/APMultiMenu.git

And add the directory APMultiMenu/ to your project

Coming Soon

  • More Customization

Author

Aadesh Patel, [email protected]

License

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

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.