ios – Does DispatchQueue(label: “com.myApp.serialQueue”) run on the main thread?


I know DispatchQueue.main.async {} runs on the main thread and DispatchQueue.global.async {}
doesn’t. But I can’t find any documentation or past question about this:

private let myQueue = DispatchQueue(label: "com.myApp.serialQueue")

@objc func appBecameActive() {
    myQueue.async {
        stuff
    }
}

Is this running on the main thread or not? And therefore is not a good thing to have in appBecameActive() because appBecameActive because the applicationDidBecomeActive method is called on the main thread, and if stuff performs a lengthy operation it’d therefore block the main thread.

My app is hanging on launch, don’t know how DispatchQueue() behaves

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img