【发布时间】:2018-04-01 17:03:14
【问题描述】:
是否可以在 iOS Playground 中加载故事板? 请按照此问题中的步骤操作:
How do you instantiate a Storyboard from a file within an iOS playground?
使用
编译 Main.storyboardibtool --compile MainMenu.nib MainMenu.storyboard
将其添加到 Playground 的 Resources 文件夹中。然后尝试加载它:
let storyboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
这会导致错误:
Playground execution aborted: Execution was interrupted, reason: signal SIGABRT.
XCode 7.3.1 甚至 XCode 8 是否支持此功能?
【问题讨论】:
-
不是整个故事板文件,但您可以插入您想要的设计。因为 StoryBoard 本身就是一个文件。
-
@Jack 不太明白。你能改写吗,拜托。你的意思是我可以添加一个 xib 吗?
标签: ios swift swift-playground