Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No main.storyboard or ViewController.swift upon initialization of new project in Xcode?

I just got Xcode and I am trying to follow an online tutorial but in every single tutorial, when a new project is made (a single activity) app, the project comes with 2 files that I simply don't have by default! I can't figure out how to make a main.storyboard or ViewController.swift file by default upon creating a project.

The only files I have are AppDelegate.swift, SceneDelegate.swift, and ContentView.swift. I also have Assets.xcassets, LaunchScreen.storyboard, Info.plist, Preview Content directory, and Products directory.

Is this part of a new update or something? Or is there some way I can get those 2 files to create upon initialization?

I tried reinstalling, and have made multiple new projects - each time they lack those 2 crucial files, so any help would be appreciated.

like image 461
Evan Avatar asked Sep 22 '19 04:09

Evan


People also ask

Why is Main storyboard not showing up in Xcode?

You have SwiftUI enabled in your project, which does not use storyboards anymore. Your layout is inside the ContentView. swift file. If you do want to work the old way, with storyboards, you should uncheck 'Use SwiftUI' in the project creation screen.

Where is Main storyboard in new Xcode?

storyboard from the Project Navigator (on the left side of Xcode). Once the Storyboard loads in the center pane, use the Object library to add a button to the storyboard.

How do I get a storyboard in Xcode?

Accessing the StoryboardSelect this file in the project navigator panel to view the storyboard canvas as illustrated in Figure 25 1. The view displayed on the canvas is the view for the ViewController class created for us by Xcode when we selected the Single View Application template.


Video Answer


1 Answers

In the latest Xcode, select Storyboard from the User Interface dropdown, enter image description here

Older Xcode

Unselect Use SwiftUI at the following step,

enter image description here

like image 117
Kamran Avatar answered Sep 28 '22 07:09

Kamran