48 lines
1.2 KiB
Markdown
48 lines
1.2 KiB
Markdown
iOS-Slide-Menu
|
|
==============
|
|
|
|
iOS Slide Menu built on top of UINavigationController
|
|
|
|
Setup
|
|
---------
|
|
```
|
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
{
|
|
LeftMenuViewController *leftMenu = [[LeftMenuViewController alloc] init];
|
|
RightMenuViewController *righMenu = [[RightMenuViewController alloc] init];
|
|
|
|
[SlideNavigationController sharedInstance].righMenu = rightMenu;
|
|
[SlideNavigationController sharedInstance].leftMenu = leftMenu;
|
|
|
|
// Override point for customization after application launch.
|
|
return YES;
|
|
}
|
|
```
|
|
Switch Between ViewControllers
|
|
----------
|
|
Let's say a menu item was selected
|
|
```
|
|
SomeViewController *vc = [[SomeViewController alloc] init];
|
|
[[SlideNavigationController sharedInstance] switchViewController:vc withCompletion:nil];
|
|
```
|
|
Configuring Left and Right menu for different Viewcontrollers
|
|
```
|
|
@interface MyViewController : UIViewController <SlideNavigationControllerDelegate>
|
|
@end
|
|
```
|
|
```
|
|
@implementation MyViewController
|
|
|
|
- (BOOL)slideNavigationControllerShoulDSisplayLeftMenu
|
|
{
|
|
return YES;
|
|
}
|
|
|
|
- (BOOL)slideNavigationControllerShouldDisplayRightMenu
|
|
{
|
|
return YES;
|
|
}
|
|
|
|
@end
|
|
```
|