Programmatically get a Storyboard ID?

后端 未结 6 1097
醉话见心
醉话见心 2020-12-02 21:52

Trying to see if a UIViewController or UIView can identify its Storyboard ID. So was hoping for:

UIViewController *aViewController;
NSString *storyboardID =         


        
6条回答
  •  情歌与酒
    2020-12-02 22:34

    You can compare with class name . import class and then try.

    NSArray *viewControllers = self.navigationController.viewControllers;
    UIViewController *root = [viewControllers objectAtIndex:0];
    if ([root isKindOfClass:[UserLogin class]]) {
    //--- do ---
    }
    

提交回复
热议问题