Connect with us


SwiftUI and Structured Concurrency

Swift 5.5 delivered an exciting frontier to explore: Swift Concurrency. If you’ve had any experience writing asynchronous code or using asynchronous APIs, you’re familiar with how complicated it can be. Debugging asynchronous code can make you feel like you’re on another world, perhaps even Mars!

The new Swift Concurrency API promises a simpler, more readable way to write asynchronous and parallel code. The more you explore the landscape of Swift Concurrency, the more you’ll discover the sophistication provided by a simple API.

In this tutorial, you’ll build Roving Mars, an app that lets you follow the Mars rovers and see the photos they take daily during their missions.

Along the way, you’ll learn:

  • How to use AsyncImage in SwiftUI to manage the presentation of remote images.
  • The difference between structured and unstructured concurrency in Swift.
  • How to use a TaskGroup to handle concurrent asynchronous tasks.
Note: This intermediate-level tutorial assumes you’re comfortable building an iOS app using Xcode and Swift. You should have used SwiftUI and have at least a beginner understanding of Swift async and await.
Full Article: Andrew Tetlaw @
Apr 11, 2022