Type 'DispatchQueue.Attributes' has no mem

2019-06-16 10:11发布

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条回答
劳资没心,怎么记你
2楼-- · 2019-06-16 10:37

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.

查看更多
登录 后发表回答