Getting this kind of errors while moving the controller from one screen to other.
Presenting view controllers on detached view controllers is discouraged.
Getting this kind of errors while moving the controller from one screen to other.
Presenting view controllers on detached view controllers is discouraged.
[self.view.window.rootViewController presentViewController:viewController animated:YES completion:nil];
when everything is finished, you can just call :
[self dismissViewControllerAnimated:YES completion:nil];
you can also refer this link : Warning :-Presenting view controllers on detached view controllers is discouraged
Following code worked for me
Display your viewController on its parent as given below:
[self.YourParentViewController presentViewController:yourPresentingViewController animated:YES completion:nil];
And dismiss like this:
[self dismissViewControllerAnimated:YES completion:nil];