iOS-Slide-Menu icon indicating copy to clipboard operation
iOS-Slide-Menu copied to clipboard

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

Open lakshmibomma opened this issue 7 years ago • 4 comments

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

lakshmibomma avatar Aug 30 '16 18:08 lakshmibomma

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...

linconz avatar Nov 11 '16 10:11 linconz

Add at presented VC something like :

  • (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if (self) { self.modalPresentationStyle = UIModalPresentationOverFullScreen; self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; } return self; }

OMGHaveFun avatar Jan 19 '17 07:01 OMGHaveFun

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];

linconz avatar Jan 22 '17 06:01 linconz

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

badalpub1991 avatar Jan 24 '17 08:01 badalpub1991