I have started a new app a few days ago and began working with the simulator to test it. I started as an empty project and manually added the storyboard. The simulator build
Update: Swift 5 and iOS 13:
Info.plist
file: SceneDelegate.swift
and change func scene
from:func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
}
to
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).x
if let windowScene = scene as? UIWindowScene {
let window = UIWindow(windowScene: windowScene)
window.rootViewController = ViewController()
self.window = window
window.makeKeyAndVisible()
}
}
Now you are good to go :)
The solution for me was, that I just needed to add the MainStoryboard to the Bundle Resources. After that, it works fine.
Project -> Build Phases -> Copy Bundle Resources -> click on the + button and add your file.
Go to your project, select your target and pull down from the menus to re-select your storyboards.
Also, you can update your plist, I found that changing one did not change the other.