Skip to content

Aadeshp/APMultiMenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

iOS Slideout Menus

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published