iphone - 如何知道当前 Storyboard名称?

标签 iphone ios storyboard uistoryboard uistoryboardsegue

我想知道当前加载的 Storyboard是什么,我使用了下面的代码,但它仍然让我得到主 Storyboard而不是当前 Storyboard。

//This get me the Main storyboard 
[[NSBundle mainBundle].infoDictionary objectForKey:@"UIMainStoryboardFile"];

最佳答案

基于 Durican 上面的回答:

在 View Controller 中:

UIStoryboard * storyboard = self.storyboard;
NSString * storyboardName = [storyboard valueForKey:@"name"];

(名称将不包含“.storyboard”文件扩展名。)

关于iphone - 如何知道当前 Storyboard名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17723732/

相关文章:

iphone - iOS 应用商店 - 应用仅提供礼品代码

iphone - NSPredicate 查询父子

ios - 滚动到底部时如何为 TableView 实现加载更多?(即上拉刷新)

ios - 1833 行 : Extra content at the end of the document when opening storyboard

iphone - 界面方向旋转

iphone - 禁用 UIButton 直到 4 个 UITextField 被填充

ios - 呈现一个新的 View Controller 而不是无限地堆叠它们?

ios - 在核心图形中传递 CGFloat 数组

ios - show Question 显示问题(null)而不是存储在数组中的问题

ios - 如何引用已添加到 Storyboard 中的图像?