Daily iOS
Networking

Provided completion code and choosing an async style

In a coding screen the company hands you completion-handler-based networking code and a JSON file, asks for a list screen, and says you can use async/await, Combine, or completion handlers. Which would you choose, and how would you connect the provided code?

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 provided code as it is, wrap it into async at the boundary with withCheckedThrowingContinuation, and write the view model with async/await.

Share a question