Warning :-Presenting View Controllers on Detached View Controllers Is Discouraged

Warning :-Presenting view controllers on detached view controllers is discouraged

One of the solution to this is if you have childviewcontroller So you simply presentviewcontroller on its parent by given

[self.parentViewController presentViewController:viewController animated:YES completion:nil];

And for dismiss use the same dismissview controller.

[self dismissViewControllerAnimated:YES completion:nil];

This is perfect solution works for me.

Presenting view controllers on detached view controllers is discouraged message when presenting modal

Thank God I found the answer!!!

var viewCon:UIViewController = self.presentingViewController!

self.dismissViewControllerAnimated(true, completion: {let storyboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)

let vc : VideoPlayViewController = storyboard.instantiateViewControllerWithIdentifier("video") as! VideoPlayViewController

vc.movieUrl = self.movieUrl

let navigationController = UINavigationController(rootViewController: vc)

viewCon.presentViewController(navigationController, animated: true, completion: nil)});

Warning: Presenting view controllers on detached view controllers is discouraged

You need to delegate the result of the download to the top-level view controller, which sounds like your UITabBarController. The UITabBarController certainly knows which tab is selected, or it can present the alert on itself.



Related Topics



Leave a reply



Submit