To run the example project, clone the repo, and run pod install
from the Example directory first.
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 {
...
}
The following properties are customizable:
- mainViewShadowEnabled
- mainViewShadowRadius
- mainViewShadowOpacity
- mainViewShadowOffset
- mainViewShadowColor
- animationDuration
- menuIndentationEnabled
- panGestureEnabled
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
- More Customization
Aadesh Patel, aadeshp95@gmail.com
APMultiMenu is available under the MIT license. See the LICENSE file for more info.