类型'DispatchQueue.Attributes'没有成员'serial' [英] Type 'DispatchQueue.Attributes' has no member 'serial'
本文介绍了类型'DispatchQueue.Attributes'没有成员'serial'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经使用Xcode8 beta4将现有的Swift2.3代码转换为Swift3.0. Xcode自动将语法转换为Swift3.0,但无法创建串行调度队列.
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)
推荐答案
不再有.serial
属性,但是调度队列是
默认情况下为序列号,除非您指定.concurrent
属性:
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)
来源: 如何使用以下方法在Swift 3中创建串行DispatchQueue Apple开发者论坛中的Xcode 8 beta 4?.
这篇关于类型'DispatchQueue.Attributes'没有成员'serial'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文