0

I am presenting a view controller programmatically but when the device is rotated it's getting auto-dismissed.

I don't know why it happens and how do I fix it

Here is the code

        UINavigationController* navC  = blah blah.
        ViewContoller* vc = blah blah

        [navC  setViewControllers:@[vc]];

        // Normal case.
        if (![[[self window] rootViewController] presentedViewController]) {
            [[[self window] rootViewController] presentViewController: navC  animated:true completion:nil];
        }

I have kept the code in appdelegate

Any help in resolving this is appreciated

Elstine P
  • 340
  • 4
  • 22

0 Answers0