我在 Swift 2 中有这样的代码:
let attrs = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_UTILITY, 0)
let myQueue = dispatch_queue_create("com.example.serial-queue", attrs)
这在 Swift 3 中无法编译,因为dispatch_queue_attr_make_with_qos_class
anddispatch_queue_create
不可用。如何使用自定义 QoS 类创建串行队列?