Info.plist configuration "(no name)" for UIWindowSceneSessionRoleApplication

Viewed 3986

I am getting the below warning and the app shows a black screen for iOS 13

[SceneConfiguration] Info.plist configuration "(no name)" for UIWindowSceneSessionRoleApplication contained UISceneDelegateClassName key, but could not load class with name MyApp.SceneDelegate.

How can I resolve this issue?

2 Answers

SceneDelegate has supported after iOS 13. If you want to use SceneDelegate and also want to support iOS prior to iOS 13 then you have to do some changes in your project.

Execute SceneDelegate if iOS 13 available.

Code:

@available(iOS 13.0, *)

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
   //Other code
}


@available(iOS 13.0, *)
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {

}

Add UIWindow object in AppDelegate.swift

class AppDelegate: UIResponder, UIApplicationDelegate {    
    var window: UIWindow?
}

For iOS 12 and earlier

AppDelegate needs a UIWindow property. iOS 13 uses SceneDelegate in new projects. Specify the UIWindow object and remove the SceneDelegate.swift file.

If you have removed the SceneDelegate from the project, then you must remove the Application Scene Manifest dictionary from Info.plist.

If there are no custom scene used other than Default one, remove 'UISceneClassName' from Info.plist.

                <key>UISceneClassName</key>
                <string></string>
Related