How to Work with Programmatic View Controllers in Xcode 12

After Xcode 12’s release, I had a mini heart attack when I tried to create a new project. This is what I am talking about:

New project, okay so far so good
What’s this?! Where’s my UIKit?!!

Method 1: Initiate Interface with SwiftUI

Step 1: Select SwiftUI as the option for your Interface in the new project. Also make sure you choose UIKit App Delegate for the Life Cycle option.

Delete this
Create a file with this
Your app’s starting point
Change this function
To this

Method 2: Initiate Interface with Storyboard

Step 1: Select Storyboard as the option for your Interface. Also make sure your Life Cycle is selected as UIKit App Delegate.

Delete Main.storyboard
Delete the Main from Main Interface and leave it empty
Delete this line
Change this function
To this

Software Engineer, I also play a lot of board games :D

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store