Swift 3.0:接收错误在创建dispatch异步队列时,无法将“int”类型的值转换为预期的参数类型“DispatchQueue.GlobalQueuePriority”
DispatchQueue.global(priority: 0).async(execute: { () -> Void in
})
警告,这在iOS 8中已被弃用,请参阅以下最新版本
DispatchQueue.global期望DispatchQueue.GlobalQueuePriority枚举,它是:
>高
>默认
>低
>背景
所以在你的情况下,你只是写:
DispatchQueue.global(priority: .background).async(execute: { () -> Void in
})
如果你想要最低优先级。
快速检查显示,在iOS 8中不推荐使用DispatchQueue.global(优先级:_)。
最新解决方案:
DispatchQueue.global(qos: .background).async {
}
这给你更多的选择:
>背景
>实用程序
>默认
> userInitiated
> userInteractive
>未指定
http://stackoverflow.com/questions/39638751/swift-3-can-not-convert-value-of-type-int-to-expected-argument-type-dispatch
本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:ios – Swift 3:无法将“int”类型的值转换为预期的参数类型“DispatchQueue.GlobalQueuePriority”