ios - 将项目迁移到 Swift 4.2 后,应用程序在黑屏上卡住

标签 ios swift

我正在从事一个基于 Swift 3.0 开发的项目。它使用 CocoaPods 作为依赖管理器。今天我终于有时间使用以下步骤将它迁移到 Swift 4.2:

  1. 将所有 pod 更新为可用的最新版本
  2. 修正了所有错误
  3. 将项目迁移到 Swift 4.2
  4. 修复所有警告

但是现在项目不运行了。实际上,它运行了,但我所拥有的只是模拟器上的黑屏,应用程序甚至不显示启动屏幕。我在 didFinishLaunchingWithOptions 上放置了一个断点,但它没有被执行。调试区中的输出不显示任何错误或异常。

我可以做些什么来了解发生了什么吗?或者我应该使用另一种策略将这个项目迁移到 Swift 4.2?

最佳答案

请更新AppDelegate方法

application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool

替换为

application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool 

关于ios - 将项目迁移到 Swift 4.2 后,应用程序在黑屏上卡住,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54754543/

相关文章:

ios - SKPaymentQueue.defaultQueue().removeTransactionObserver(self) 删除和添加

Swift - 我想从 View Controller 中的 SceneDelegate.swift 访问信息

swift - 处理算术溢出 UInt32 (CUnsignedInt)

ios - `CAGradientLayer` 根据局部坐标空间定义起点和终点

objective-c - 使用主视图中的数据在 subview 上加载数组

ios - 以编程方式将 UITapGestureRecognizer 添加到 Outlet Collection 中的 UIView

ios - AdMob ARMv7s 支持

ios - Swift AFNetworking POST 错误

ios - 如何以编程方式或其他方法跟踪我的 iOS 应用程序的蜂窝数据使用情况?

ios - 调用 SKLabelNode 时延迟?