Bird
0
0

What is the main purpose of a Task in Swift concurrency?

easy📝 Conceptual Q11 of 15
iOS Swift - Concurrency
What is the main purpose of a Task in Swift concurrency?
ATo run a single background job asynchronously
BTo group multiple tasks and run them together
CTo update the UI on the main thread
DTo pause the app execution
Step-by-Step Solution
Solution:
  1. Step 1: Understand what Task does

    A Task is designed to run one asynchronous job in the background.
  2. Step 2: Differentiate from TaskGroup

    TaskGroup runs many jobs together, not a single job.
  3. Final Answer:

    To run a single background job asynchronously -> Option A
  4. Quick Check:

    Task = single background job [OK]
Quick Trick: Task runs one job; TaskGroup runs many [OK]
Common Mistakes:
  • Confusing Task with TaskGroup
  • Thinking Task updates UI directly
  • Assuming Task pauses app execution

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More iOS Swift Quizzes