I can\'t seem to get the top most UIViewController
without access to a UINavigationController
. Here is what I have so far:
UIApplic
Where did you put the code in?
I try your code in my demo, I found out, if you put the code in
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
will fail, because key window have been setting yet.
But I put your code in some view controller's
override func viewDidLoad() {
It just works.