Usaly when you present a viewController from another viewController you do:
let vc : UIViewController = storyboard.instantiateViewControllerWithIdentifier("viewController") as UIViewController;
self.presentViewController(vc, animated: true, completion: nil);
I want to present a viewController from a SKScene. I haven't found any way of doing that. This question might be a duplicate, but i have just found answers in objective C that doesn't make sense to me
Try the following in your scene class:
var currentViewController:UIViewController=UIApplication.sharedApplication().keyWindow.rootViewController!
currentViewController.presentViewController(viewController, animated: true, completion: nil)
I hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With