2
votes

Getting this kind of errors while moving the controller from one screen to other.

Presenting view controllers on detached view controllers is discouraged.

2
How you are presenting your view controller? add that code in question!Ketan Parmar
can you show ur try code or storyboard sceneAnbu.Karthik

2 Answers

1
votes
  [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

0
votes

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