- Create a new single view app project in Xcode.
- Select Swift as the language and deselect the option to use Storyboard as the interface.
- Delete the
Main.storyboard
file. - Remove the
Main
value config entries in Build Settings. - Remove the key
UIMainStoryboardFile
orStoryboard Name
and valueMain
in the Info.plist.
- Create a new file called
HelloWorldViewController.swift
Replace the content of the function scene(_:willConnectTo:options:)
with:
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(frame: windowScene.coordinateSpace.bounds)
window?.windowScene = windowScene
window?.rootViewController = HelloWorldViewController()
window?.makeKeyAndVisible()