How do I access my viewController from my appDelegate? iOS

You can access it with:

MyViewController* mainController = (MyViewController*)  self.window.rootViewController;

If you are nesting your view behind a tabviewcontroller or navigation controller it will return that to you and you will need to access your view controller inside of it

Leave a Comment