Bird
0
0

What does marking a function with async in Swift mean?

easy📝 Conceptual Q11 of 15
iOS Swift - Concurrency
What does marking a function with async in Swift mean?
AThe function cannot call other functions.
BThe function runs only once and then stops.
CThe function must return an integer value.
DThe function can pause and resume without blocking the app's main thread.
Step-by-Step Solution
Solution:
  1. Step 1: Understand async function behavior

    Async functions allow pausing and resuming work without freezing the app's main thread.
  2. Step 2: Compare options with async meaning

    Only The function can pause and resume without blocking the app's main thread. correctly describes this behavior; others are unrelated or incorrect.
  3. Final Answer:

    The function can pause and resume without blocking the app's main thread. -> Option D
  4. Quick Check:

    Async means non-blocking pause/resume = A [OK]
Quick Trick: Async means work happens without freezing UI [OK]
Common Mistakes:
  • Thinking async means the function runs only once
  • Confusing async with return types
  • Believing async functions cannot call others

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More iOS Swift Quizzes