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

how to present view controller modally on main view..not on navigation controller left view #232

Open lakshmibomma opened 8 years ago

lakshmibomma commented 8 years ago

how to present view controller modally on main view..not on navigation controller left view.. I am trying to present view controller modally on right view controller..but background view is left view always..and also getting error view is not in the window hierarchy...please help me

linconz commented 7 years ago

I have same issue. I have a main ViewController and left menu ViewController, now, at left menu controller have a button, when user click the button, want to present a login view controller from appdelegate.window.rootviewcontroller. But in fact the interface is block on the left menu controller...

OMGHaveFun commented 7 years ago

Add at presented VC something like :

linconz commented 7 years ago

well.. I found a way to present:

The first step: In the SlideNavigationController.m, add this code:

- (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion
{
    [super presentViewController:viewControllerToPresent animated:flag completion:completion];
}

The second step: in your left menu controller or root view controller, use this:

UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main"
                                                             bundle: nil];
LoginViewController *viewController = (LoginViewController *)[mainStoryboard instantiateViewControllerWithIdentifier: @"LoginViewController"];
[[SlideNavigationController sharedInstance] presentViewController:viewController animated:YES completion:nil];
badalpub1991 commented 7 years ago

it donsnt have navigation controller . is there any option for that ??