我已经使用 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)
Source: 如何使用 Xcode 8 beta 4 在 swift 3 中创建串行 DispatchQueue? https://developer.apple.com/forums/thread/53270在苹果开发者论坛中。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)