iOS-Slide-Menu
iOS-Slide-Menu copied to clipboard
Doesn't work unless I start my project with SNC in didFinishLaunchingWithOptions
I'm trying to start the SNC by a button in a viewcontroller. If I use the following code in that button, the SlideNavigationController's left menu doesn't work (it's completely unresponsive). However, if I paste the EXACT SAME CODE in ApplicationDidFinishLaunchingWithOptions, then everything works fine.
NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"Lights" ofType:@"bundle"];
NSBundle *lights = [NSBundle bundleWithPath:bundlePath];
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:lights];
SlideNavigationController *nc = (SlideNavigationController*)[sb instantiateViewControllerWithIdentifier: @"SlideNavigationController"];
ViewController *vc = [sb instantiateViewControllerWithIdentifier:@"ViewController"];
MenuViewController * _mvc = [[MenuViewController alloc] initWithNibName:@"MenuViewController" bundle: lights];
[SlideNavigationController sharedInstance].leftMenu = _mvc;
[SlideNavigationController sharedInstance].rightMenu = vc;
self.window.rootViewController = nc; //(or [self presentvc: ... ]
EDIT: Looks like I found out what was wrong (still haven't fixed it). A UITransitionView is covering the LeftMenuVC, so it can't be touched.