Xcode Missing View Controllers

I have seen a lot of questions recently from people who are creating iOS projects in Xcode and not being able to find the ViewController.swift file and not being able to find view controllers. Usually these questions come from people who are following a tutorial written with an earlier version of Xcode.

The cause of the issue is that Xcode defaults to using SwiftUI for new iOS and Mac projects.

user interface menu

SwiftUI is a new framework from Apple for making user interfaces for Apple devices. SwiftUI does not use view controllers so when you create a SwiftUI project, there aren’t going to be any view controllers in the project.

The solution to the issue is to choose Storyboard from the User Interface menu when you create the project. When you tell Xcode to use storyboards for the user interface, your project will include a view controller and a ViewController.swift file.

Get the Swift Dev Journal Newsletter

Subscribe and get exclusive articles, a free guide on moving from tutorials to making your first app, notices of sales on books, and anything I decide to add in the future.

    We won't send you spam. Unsubscribe at any time.