Is DispatchQueue.global(qos: .userInteractive).async same as DispatchQueue.main.async

前端 未结 5 1688
一整个雨季
一整个雨季 2020-12-30 19:09

I was going through the tutorial : https://www.raywenderlich.com/148513/grand-central-dispatch-tutorial-swift-3-part-1

And came across the definition of QoS class

5条回答
  •  暖寄归人
    2020-12-30 19:28

    You can use DispatchQueue.global(qos: .userInteractive).async{} when you want to do something very fast in the background while the user is interacting with your app. This is rarely used because, as it has to happen so quickly, you probably can do it directly in the main queue.

    You can check this lecture where this issue is quite clearly explained.

提交回复
热议问题