aryaxt / iOS-Slide-Menu

iOS Slide Menu with ability to add both left and right menu, and built in gesture recognizer. Similar to Path and Facebook
Other
1.53k stars 359 forks source link

SlideNavigationController has not been initialized. in didFinishLaunchingWithOptions #220

Open ji3g4m6zo6 opened 8 years ago

ji3g4m6zo6 commented 8 years ago
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
    LeftMenuViewController *leftMenu = (LeftMenuViewController*)[mainStoryboard instantiateViewControllerWithIdentifier: @"LeftMenuViewController"];
    [SlideNavigationController sharedInstance].leftMenu = leftMenu;
    [SlideNavigationController sharedInstance].menuRevealAnimationDuration = .18;
    return YES;
}

When the app runs to : [SlideNavigationController sharedInstance].leftMenu = leftMenu;

I got the message :

SlideNavigationController has not been initialized. Either place one in your storyboard or initialize one in code

How can I fix it?

Thanks for your help.

orenk86 commented 8 years ago

As the error states, you need to embed the VC which you want to show the menu from, in a UINavigationController, and set it to the SlideNavigationController class...