technerd technerd - 1 year ago 128
Swift Question

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

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)

Answer Source

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: in the Apple Developer Forum.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download