Get UIViewController class name in iOS

后端 未结 4 2257
广开言路
广开言路 2021-02-20 01:58

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

4条回答
  •  走了就别回头了
    2021-02-20 02:22

    Use this It may Help's you

     NSString *CurrentSelectedCViewController = NSStringFromClass([[((UINavigationController *)viewController1) visibleViewController] class]);
    

提交回复
热议问题