Bird
0
0

Which keyword must be used to call an async function in Swift?

easy📝 Conceptual Q2 of 15
iOS Swift - Concurrency
Which keyword must be used to call an async function in Swift?
Atry
Basync
Cdefer
Dawait
Step-by-Step Solution
Solution:
  1. Step 1: Identify how to call async functions

    Async functions must be called with the await keyword to pause execution until the async task completes.
  2. Step 2: Differentiate from other keywords

    async declares functions, defer schedules code to run later, and try handles errors.
  3. Final Answer:

    await -> Option D
  4. Quick Check:

    Call async function with = await [OK]
Quick Trick: Use await to pause until async function finishes [OK]
Common Mistakes:
  • Using async instead of await when calling
  • Confusing defer with async calls
  • Omitting await causing compile errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More iOS Swift Quizzes