I'm trying to do a new iOS app in Xcode. I made a main storyboard and I added a label on my ViewController. When I run my application, first second it show the label and then become the screen black without any errors.
I'm working on Xcode 11 (Swift 5) and this message appears on output:
[SceneConfiguration] Info.plist configuration "Default Configuration" for UIWindowSceneSessionRoleApplication contained UISceneDelegateClassName key, but could not load class with name "gina.SceneDelegate"
I don't know where my mistake is.
If the app freezes up and the screen goes black when trying to load a video or media content, it could be an issue with the internet connection, or internet connection speed. This could also be due to some throttling going on by an ISP itself, or by the media delivery network, or some other related provider.
app on your Android mobile device, this is likely due to an incompatibility issue with Android System Webview. This issue may occur immediately upon opening the application, when trying to sign in, or when creating a new account.
Only if target is 13 or greater.
SceneDelegate
is not supported before iOS 13. If you want to use SceneDelegate
and also want to support iOS prior to iOS 13 then you a have to add some changes to your project.
@available(iOS 13.0, *) class SceneDelegate: UIResponder, UIWindowSceneDelegate { ... }
SceneDelegate
method. Add availability attribute to them as well.@available(iOS 13.0, *) func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { ... } @available(iOS 13.0, *) func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { ... }
UIWindow
object in AppDelegate.swift.class AppDelegate: UIResponder, UIApplicationDelegate { //Add this line var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } ... }
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 project, then you must remove the Application Scene Manifest dictionary from Info.plist.
You need to initialize the window like this:
let window = UIWindow(windowScene: scene as! UIWindowScene)
and add these in info.plist:
<key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict> <key>UIWindowSceneSessionRoleApplication</key> <array> <dict> <key>UILaunchStoryboardName</key> <string>LaunchScreen</string> <key>UISceneConfigurationName</key> <string>Default Configuration</string> <key>UISceneDelegateClassName</key> <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string> </dict> </array> </dict> </dict>
That's all you need to do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With