iOS-Slide-Menu
iOS-Slide-Menu copied to clipboard
SlideNavigationController has not been initialized. in didFinishLaunchingWithOptions
- (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.
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...