I am trying to present a view controller (a passcode request type view) every time my app becomes active. Once the correct passcode is entered, it should pop off the stack.
Swift version of Quick and generalised way:
getRootViewController().presentViewController(messageVC, animated: true, completion: nil) func getRootViewController() -> UIViewController { return (UIApplication.sharedApplication().delegate?.window??.rootViewController)! }