Swift 5: How to set up your initial ViewController without a Storyboard in Xcode
Step 1: Make a new Xcode project and delete Main.storyboard as we won’t be needing it for this tutorial.
Step 2: Next, open Info.plist and delete the“Main storyboard file base name” line and the “Storyboard Name” line
Step 3: Now let’s navigate to ViewController.swift and populate it with a UILabel so that we know if we’re successful in presenting ViewController.swift
Step 4: Open SceneDelegate.swift and type the following code into the “scene” function. This will set ViewController.swift as the rootViewController:
Now build and run your project to see the final product!
Applaud this article if you enjoyed the tutorial!