zoukankan      html  css  js  c++  java
  • 新建swift工程直接爆红,而且运行起来是黑屏的解决方法

    1.在AppDelegate.swift里添加@available(iOS 13.0, *),和var window: UIWindow?

    @UIApplicationMain
      @available(iOS 13.0, *)
    class AppDelegate: UIResponder, UIApplicationDelegate {
    
    
    var window: UIWindow?
        func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
            // Override point for customization after application launch.
            return true
        }

    2.在SceneDelegate.swift添加@available(iOS 13.0, *), var window: UIWindow?

    import UIKit
    @available(iOS 13.0, *)
    class SceneDelegate: UIResponder, UIWindowSceneDelegate {
    
        var window: UIWindow?
    
    
        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 }
        }
  • 相关阅读:
    Go语言通道(chan)——goroutine之间通信的管道
    GO语言数组,切片,MAP总结
    GO数组
    GO切片
    GO语言测试
    GO语言html模板
    Go语言中defer语句使用小结
    微信小程序 某个页面直接返回首页
    小程序常用变量
    bzoj1030
  • 原文地址:https://www.cnblogs.com/Percy/p/13072801.html
Copyright © 2011-2022 走看看