How to create dispatch queue in Swift 3

前端 未结 15 1869
余生分开走
余生分开走 2020-11-22 16:35

In Swift 2, I was able to create queue with the following code:

let concurrentQueue = dispatch_queue_create(\"com.swift3.imageQueue\", DISPATCH_QUEUE_CONCURR         


        
15条回答
  •  隐瞒了意图╮
    2020-11-22 17:22

    it is now simply:

    let serialQueue = DispatchQueue(label: "my serial queue")
    

    the default is serial, to get concurrent, you use the optional attributes argument .concurrent

提交回复
热议问题