【发布时间】:2016-10-20 20:01:05
【问题描述】:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
print(UIApplicationBackgroundFetchIntervalMinimum)
UIApplication.shared.setMinimumBackgroundFetchInterval(UIApplicationBackgroundFetchIntervalMinimum)
return true
}
func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
completionHandler(.newData)
}
这是我的代码,当我在 XCode 中调试 > 模拟后台获取我的应用程序崩溃时,没有任何原因。我在功能>后台模式>后台获取...有什么想法吗?
它只在模拟器中的 iPhone 上崩溃我没有问题。
【问题讨论】:
-
你的应用在哪一行崩溃了?
-
检查我的答案
-
@MuhammadNoman Swift 3 在 iOS 10 XCode 8 上
-
不管你用的是 swift 3 ,还是从这里拿个概念不要跟
标签: ios swift3 ios10 background-fetch