识别UIStoryboard

你如何识别UIStoryboard?

这个类有创build和实例化的方法,但是我没有看到类似name的@property。 例如

获取故事板对象

 + storyboardWithName:bundle: 

实例化Storyboard视图控制器

 – instantiateInitialViewController – instantiateViewControllerWithIdentifier: 

有什么build议么?

====更新

我希望像self.storyboard.name[self.storyboard description] ,例如:

 NSLog(@"This Storyboard is: %@", self.storyboard.name); 

也许这并不意味着。

您可以在项目导航器中通过名称来识别故事板:

在这里输入图像说明

您可以通过在界面构build器中的身份检查器中设置其故事板ID来从故事板中识别视图控制器:

在这里输入图像说明

一旦你有这些,那么你可以通过你的代码访问它们:

 UIStoryboard *iPhoneStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil]; ViewController *firstViewController = [iPhoneStoryboard instantiateViewControllerWithIdentifier:@"FirstViewController"];