There are plenty of valid reasons to use storyboards or to programmatically lay out your interface. Storyboards let us quickly build out a beautiful interface, but face limitations and scale problems. If you have a team working on an app, then Storyboards can get messy and hard to keep track of with version control. Once you decide that storyboards aren’t the tool for you, Xcode takes some tinkering to set things up to lay out your interface in Swift. After you create your project,

First, delete the Main.storyboard. Yup, delete it entirely.

Then, we have to delete any reference to it- The first spot we need to take care of is the reference to Main.storyboard in Info.plist — Go ahead and delete the entry by clicking the minus sign. The last place it’s referenced is in the Deployment Info section of your project settings. A dropdown for Main Interface will still say Main.storyboard, Select the empty option in the dropdown.

Next, add the following to your SceneDelegate.swift

guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(frame: windowScene.coordinateSpace.bounds)
window?.windowScene = windowScene
window?.rootViewController = ViewController()

Now, you can specify your actual layout in ViewController.swift!

You’re all set up to implement the design of your dreams programmatically, and here’s a quick reference to help you get the hang of it!