- Remove
Main.storyboard
file from the bundle. - Remove
main
from Target/General/Main Interface - Remove
Main
fromInfo.plist
atApplication Scene Manifest/Scene Configuration/Application Session Role/Default Configuration
. - Instantiate
window
with first view controller inSceneDelegate
.
Replace this method.
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
}
With this.
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
if let windowScene = scene as? UIWindowScene {
let window = UIWindow(windowScene: windowScene)
window.rootViewController = ViewController()
self.window = window
window.makeKeyAndVisible()
}
}
Which resembles the iOS 13 SwiftUI template by the way.