If I create a Tab Bar Application project template with storybard and put this in my AppDelegate.m:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSLog(@"Root: %@", self.window.rootViewController);
NSLog(@"Current ViewController: %@", /*self.window.rootViewController.selectedIndexOrSomething?*/ );
return YES;
}
It says: Root: <UITabBarController: 0x6b20360>
So I guess the TabBarController is already added as a subView of the window property as I have not touched the AppDelegate in any other way than NSLog.
How to log the current tab/ViewController?
You will want to do this: