Mixing Combine and async/await in the same project?

I'm working on an iOS project and I'm wondering if it's possible to mix Combine and the new async/await feature in Swift. I want to leverage the power of Combine's reactive programming paradigm along with the simplified asynchronous code flow provided by async/await.

Has anyone tried mixing these two approaches in the same project? Are there any known issues or considerations to keep in mind? Are there any best practices or patterns to follow when combining Combine and async/await?

I would appreciate any insights or experiences shared. Thank you in advance!

Replies

It’s certainly possible to mix Combine and Swift concurrency in the same project. Indeed, there are specific affordances for this. For example, every publisher has a values property that vends an async sequence.

Having said that, I don’t have a lot of direct experience with this myself, so I’ll let others wade in or your best practices question. But if you have any specific API-level follow-up questions, post ’em here and I’ll see what I can do to answer them.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"