Daily iOS
Concurrency

Completion handlers to async

You have an old networking layer built on completion handlers, called from hundreds of places across the app. How would you move it to async/await without breaking all the call sites at once?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Leave the existing completion API alone and add an async overload beside it that wraps the old implementation in withCheckedThrowingContinuation, then migrate call sites screen by screen. No reverse bridging that makes async synchronous with a semaphore.

Share a question