How to Remove the Dependency of Main.storyboard File in an iOS Project

1) Delete Main.storyboard File

In the project navigator, delete the Main.storyboard file (when prompted, click “Move to Trash”).

2) Delete “Storyboard Name” Reference in Info.plist File

In the project navigator, select the Info.plist file. Press Cmd+F and type “Storyboard Name” to find and delete the highlighted line. (To delete, use Cmd+Backspace)

3) Delete “UIKit Main Storyboard …” Reference from Build Settings

In the project navigator, select the very first row (project name) and on the right side, select the “Build Settings” tab. In the search bar, look for “Storyboard” and, like the previous step, remove the reference.

4) Make Sure That You Can Compile the Project

At this point, your project should be able to compile; however, we still need to set up some initialization code.

5) Set Up Initialization Code in SceneDelegate.swift (after iOS 13.0)

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
    guard let windowScene = scene as? UIWindowScene else { return }

    window = UIWindow(windowScene: windowScene)
    window?.rootViewController = RootViewController() // Inject your root UIViewController derived class here.
    window?.makeKeyAndVisible()
    window?.rootViewController?.view.backgroundColor = .systemBlue
}