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

问题描述:

我已经使用Xcode8 beta4将现有的Swift2.3代码转换为Swift3.0。 Xcode自动将语法转换为Swift3.0,但无法创建串行调度队列。类型'DispatchQueue.Attributes'没有任何成员'serial'

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

没有.serial属性了,但调度队列 由默认的序列,除非你指定.concurrent属性:

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

来源:https://forums.developer.apple.com/message/159457#159457 在苹果开发者论坛。

+0

它工作正常。谢谢!!! – technerd