Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if rootViewController is of a specific class?

Tags:

ios

iphone

I would like to know if the rootViewController in a navigation controller stack is of specific class. How to do such a thing ?

Thx for helping,

Stephane

like image 625
user963160 Avatar asked Dec 29 '25 06:12

user963160


1 Answers

Here you go buddy

id rootController = [self.navigationController rootViewController];
if([rootController isKindOfClass:[YourDesiredController class]]){
  //do something
 }
like image 119
Rahul Vyas Avatar answered Dec 30 '25 20:12

Rahul Vyas