John-Lluch / SWRevealViewController

A UIViewController subclass for presenting side view controllers inspired on the FaceBook and Wunderlist apps, done right !
Other
4.52k stars 988 forks source link

How to get current viewController #562

Open stephen-talari opened 8 years ago

stephen-talari commented 8 years ago

I have some callbacks in AppDelegate which are called when internet connection is lost, based on that callback i have to show some subview on current view. How can i get current view controller?

iDevelopper commented 8 years ago

I'm doing this:

UIViewController *topController = self.window.rootViewController;
while (topController.presentedViewController) topController = topController.presentedViewController;