Type 'DispatchQueue.Attributes' has no member 'serial'

 ̄綄美尐妖づ 提交于 2019-12-08 16:00:33

问题


I have converted existing Swift2.3 code to Swift3.0 using Xcode8 beta4. Xcode automatically convert syntax to Swift3.0, but it not able to create serial dispatch queue.

private let serialQueue = DispatchQueue(label: "identifier", qos: DispatchQueue.Attributes.serial)


回答1:


There is not .serial attribute anymore, but dispatch queues are by default serial, unless you specify the .concurrent attribute:

let serialQueue = DispatchQueue(label: "label")
let concurrentQueue = DispatchQueue(label: "label", attributes: .concurrent)

Source: https://forums.developer.apple.com/message/159457#159457 in the Apple Developer Forum.



来源:https://stackoverflow.com/questions/39344924/type-dispatchqueue-attributes-has-no-member-serial

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!