By default when you create a Xcode project, it lets you choose whether you want to create it in Storyboard or SwiftUI. If you choose storyboard, it will automatically create a storyboard for you in Xcode 14.
In order to remove the storyboard, you would need to do the following
- Delete the Main.storyboard file.
![](https://i0.wp.com/redflowerinc.com/wp-content/uploads/2022/11/Screen-Shot-2022-11-22-at-3.29.28-PM-1.png?resize=1012%2C180&ssl=1)
2. Go to Targets -> Select your target -> Click on the Info tab
3. Delete the row Main Storyboard file base name
![](https://i2.wp.com/redflowerinc.com/wp-content/uploads/2022/11/Screen-Shot-2022-11-22-at-3.31.08-PM.png?fit=640%2C321&ssl=1)
4. Expand Application scene manifest. Drill down and delete the row Storyboard name.
![](https://i0.wp.com/redflowerinc.com/wp-content/uploads/2022/11/Screen-Shot-2022-11-22-at-3.33.10-PM.png?fit=640%2C419&ssl=1)
5. Open SceneDelegate class and update the code in the following method
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 }
}
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 windowScene = (scene as? UIWindowScene) else { return }
let window = UIWindow(windowScene: windowScene)
window.rootViewController = ViewController() // Your initial view controller.
window.makeKeyAndVisible()
self.window = window
}
6. Run the code, you should be able to run the new view controller.
Leave a Reply