问题
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:
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.
来源:https://stackoverflow.com/questions/39344924/type-dispatchqueue-attributes-has-no-member-serial