I am getting viewControllers on navigationController stack as follows. Now I need to check if controller on top is one of known vc. How to get vc class name in order to compare
The most common technique is to use -isKindOfClass:
-isKindOfClass
if ([[viewContrells lastObject] isKindOfClass:MyViewController.class]]) { // ... }
Using NSStringFromClass to compare strings is not a very nice solution because your code will break if you refactor the view controller to rename it.
NSStringFromClass