I wanted to ad an option into my application to change the initial ViewController so users can skip the login view.
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)
}
}
if I try it like this, it always shows me this fail message: Could not find a storyboard named 'MenuViewController' in bundle ...