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

Doesn't work unless I start my project with SNC in didFinishLaunchingWithOptions #218

Open jamrader opened 8 years ago

jamrader commented 8 years ago

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.