Hello there, i would like to know how to show a storyboard from a swift file; In my case i tried many times but it won’t work..
So, i made a Login/Sign-Up page were the user can login/sign-up to my application, and i called it Login.storyboard
, then i have another file which is SettingsViewController.swift
where i have my menù etc... and till here everything works, but then i made a voice on the SettingsViewController.swift
which is:
case 0:
if let loginStoryboard = UIStoryboard(name: "Login", bundle: nil).instantiateViewController(withIdentifier: "LoginNavigationController") as? UINavigationController {
present(loginStoryboard, animated: true, completion: nil)
} else {
print("Failed to instantiate LoginNavigationController from Login.storyboard")
}
So, this stuff should show my Login.storyboard
, but when i press on the button from my phone, everything stops and the last message i receive from logs is:
libc++abi: terminating due to uncaught exception of type NSException
Does somebody know what should i fix? Thanks.
Here it is the full exemption:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'Login' in bundle NSBundle </private/var/containers/Bundle/Application/419533A3-EE96-494C-A08C-3430206CEC7F/[AppNameOmitted].app> (loaded)'
*** First throw call stack:
(0x19aae0870 0x192dffc00 0x19cf82b8c 0x104b8ef64 0x104b8d52c 0x104b8f584 0x19dc015c0 0x19dc018ec 0x19dc019ec 0x19ccc87f4 0x19ccc85d8 0x19ccc84f0 0x19ccc826c 0x19ccc8160 0x19ccc7c64 0x19ccc7354 0x19ccc7410 0x19aa2b31c 0x19aa2a598 0x19aa28d4c 0x19aa27a88 0x19aa27668 0x1dddf25ec 0x19ce49fa0 0x19ce495dc 0x104b8563c 0x1bd481dcc)
libc++abi: terminating due to uncaught exception of type NSException