ios – Swift 3警告发送异步

我有这个代码:

DispatchQueue.global(priority: DispatchQueue.GlobalQueuePriority.default).async {
                let url = URL(string: itemImageURL )
                let data = try? Data(contentsOf: url!)
                if data != nil {
                    DispatchQueue.main.async{
                        cell.advImage!.image = UIImage(data: data!)
                    }
                }
            }

我在Swift 3中得到这个警告:

‘default’ was deprecated in iOS 8.0: Use qos attributes instead

在第一行。

还没有找到解决方案。有人吗

尝试qos:DispatchQoS.QoSClass.default而不是优先级:DispatchQueue.GlobalQueuePriority.default

DispatchQueue.global(qos: DispatchQoS.QoSClass.default).async {
            let url = URL(string: itemImageURL )
            let data = try? Data(contentsOf: url!)
            if data != nil {
                DispatchQueue.main.async{
                    cell.advImage!.image = UIImage(data: data!)
                }
            }
        }
翻译自:https://stackoverflow.com/questions/39791035/swift-3-warning-for-dispatch-async

转载注明原文:ios – Swift 3警告发送异步