I have many navigation controllers and one tab bar controller in my app. Now i want to check if currently i am on navigation view or tab bar view. How can i check for my current view class.
NSString *className=self.window.rootViewController.description;
NSLog(@"class name is %@ ",className);
When I am on navigation controller view the output is :
class name is <UINavigationController: 0x1cd78780>
And when i am on tab bar controller, It prints
class name is <UITabBarController: 0x1cdbd8d0>
How can i recognize them. Thanks in advance.
1 Answer