I am using Combine and SwiftUI to do some async stuff, the point is that I don't know how to receive the response from the asynchronous operation in the main thread. The apple doc says that it can be used the RunLoop.main, but currently in Swift 5.0 it isn't a Scheduler. So any ideas about this?
I have tried to use as per apple doc, but no luck.
anyPublisher
.receiveOn(on: RunLoop.main)
Combine
- at the time of writing - is not fully integrated inFoundation
.According to Xcode 11 Beta Release Notes:
As per the latest Xcode 11 beta (2), this has been fixed, so expect your code to work correctly.
Thanks to @Martin R and @silicon_valley for the update.