类型 'DispatchQueue.Attributes' 没有成员 'serial'
Type 'DispatchQueue.Attributes' has no member 'serial'
我已经使用 Xcode8 beta4 将现有的 Swift2.3 代码转换为 Swift3.0。 Xcode自动将语法转换为Swift3.0,但无法创建串行调度队列。
private let serialQueue = DispatchQueue(label: "identifier", qos: DispatchQueue.Attributes.serial)
不再有 .serial
属性,但是调度队列是
默认情况下是连续的,除非你指定 .concurrent
属性:
let serialQueue = DispatchQueue(label: "label")
let concurrentQueue = DispatchQueue(label: "label", attributes: .concurrent)
来源: How to create a serial DispatchQueue in swift 3 with Xcode 8 beta 4? Apple 开发者论坛。
我已经使用 Xcode8 beta4 将现有的 Swift2.3 代码转换为 Swift3.0。 Xcode自动将语法转换为Swift3.0,但无法创建串行调度队列。
private let serialQueue = DispatchQueue(label: "identifier", qos: DispatchQueue.Attributes.serial)
不再有 .serial
属性,但是调度队列是
默认情况下是连续的,除非你指定 .concurrent
属性:
let serialQueue = DispatchQueue(label: "label")
let concurrentQueue = DispatchQueue(label: "label", attributes: .concurrent)
来源: How to create a serial DispatchQueue in swift 3 with Xcode 8 beta 4? Apple 开发者论坛。