Somewhere along the line this became possible:
addObserver(forName:object:queue:using:)
which is here , but the whole point is the queue object.
The operational queue to which the block should be added. If you pass nil , the block runs synchronously in the posting thread.
So how do you get a queue that matches the main runloop?
let mainQueue = OperationQueue.main
Note: this is when you sign up for notifications, so you do it once, and you're done. Doing this with every call is terribly redundant.
Dan Rosenstark Mar 15 '17 at 4:03 on 2017-03-15 04:03
source share