类型'DispatchQueue.Attributes'没有成员'serial'

tec*_*erd 9 grand-central-dispatch ios swift swift3

我已经使用Xcode8 beta4将现有的Swift2.3代码转换为Swift3.0.Xcode自动将语法转换为Swift3.0,但它无法创建串行调度队列.

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

Mar*_*n R 23

没有.serial属性,但调度队列默认是串行的,除非您指定.concurrent属性:

let serialQueue = DispatchQueue(label: "label")
let concurrentQueue = DispatchQueue(label: "label", attributes: .concurrent)
Run Code Online (Sandbox Code Playgroud)

来源: Apple开发者论坛中的https://forums.developer.apple.com/message/159457#159457.