NSOperationQueue
class has an underlyingQueue
property which is used to set the dispatch queue on which NSOperation
instances will be executed.
let dispatchQueue = dispatch_queue_create("custom.queue", DISPATCH_QUEUE_SERIAL)
let opQueue = NSOperationQueue()
opQueue.underlyingQueue = dispatchQueue
However, official documentation states that:
The value of this property must not be the value returned by
dispatch_get_main_queue
It seems that there is no more explanation on this subject from Apple. However, using main queue as underlyingQueue
does not raises any errors nor does it yields any unwanted behavior. What is the reasoning behind this?