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
How to Compress of Reduce the Size of an Image Before Uploading to Parse as Pffile? (Swift)
Ios 6: How to Restrict Some Views to Portrait and Allow Others to Rotate
Detect If the App Was Launched/Opened from a Push Notification
Check For Internet Connection Availability in Swift
Enabling Auto Layout in iOS 6 While Remaining Backwards Compatible With iOS 5
Iphone Smooth Sketch Drawing Algorithm
Nsurlconnection Using iOS Swift
How to Get the Status of Bluetooth (On/Off) in iPhone Programmatically
How to Open PDF File Using Uiwebview on iOS
How to Resize the Iphone/iPad Simulator
Execute Action When Back Bar Button of Uinavigationcontroller Is Pressed
Warning :-Presenting View Controllers on Detached View Controllers Is Discouraged
Detect When an iOS App Is Launched For the First Time
How to Set the Width of a Cell in a Uitableview in Grouped Style
Detect Current Device With Ui_User_Interface_Idiom() in Swift