【发布时间】:2016-07-15 15:24:07
【问题描述】:
我想在我的应用程序中添加一个选项来更改初始 ViewController,以便用户可以跳过登录视图。
class SettingsViewController: UIViewController {
var vc: UIViewController?
@IBOutlet var changeInitialView: UISwitch?
@IBAction func changeButton(sender: UIButton) {
if changeInitialView!.on {
print("Switch is off")
vc = UIStoryboard(name: "MenuViewController", bundle: nil).instantiateViewControllerWithIdentifier("MenuViewController")
changeInitialView!.setOn(false, animated:true)
} else {
print("Switch is on")
changeInitialView!.setOn(true, animated:true)
}
}
如果我这样尝试,它总是向我显示以下失败消息: 在捆绑包中找不到名为“MenuViewController”的情节提要...
【问题讨论】: