如何初始化从操场主要故事板

问题描述 投票:-1回答:1

我用下面简单的代码来初始化内部游乐场的故事板:

let storyboard = UIStoryboard(name: "Main", bundle: nil)
let controller = storyboard.instantiateViewController(withIdentifier:"ViewController")

PlaygroundPage.current.liveView = controller

视图控制器是嵌入在可可触摸框架内的公共类,因为我想分享这个代码的操场,但我得到这个错误:

enter image description here

如果我创建一个新的故事板用一个简单的UIViewController一切working.Any想法?

ios swift uiviewcontroller storyboard swift-playground
1个回答
-1
投票

找到你要设定的目标会员资格Main.storyboard两个框架和你的项目的解决方案

© www.soinside.com 2019 - 2024. All rights reserved.