小编Rav*_*nth的帖子

iOS 13 UIBackgroundTaskIdentifier

无法结束 BackgroundTask:不存在带有 identifier 的后台任务,或者它可能已经结束。中断 UIApplicationEndBackgroundTaskError() 进行调试。

self.backgroundTaskIdentifier = UIApplication.shared.beginBackgroundTask(expirationHandler: {
     if self.backgroundTaskIdentifier != UIBackgroundTaskIdentifier.invalid{
                UIApplication.shared.endBackgroundTask(self.backgroundTaskIdentifier!)
                self.backgroundTaskIdentifier = UIBackgroundTaskIdentifier.invalid
            }
})
Run Code Online (Sandbox Code Playgroud)

ios13 xcode11 swift5.1

5
推荐指数
0
解决办法
741
查看次数

标签 统计

ios13 ×1

swift5.1 ×1

xcode11 ×1