Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

Issue 264
Mar 25, 2025

This week's SwiftLee Weekly covers:

  • SwiftData's ModelActor is weird
  • A new FlowNavigation library for SwiftUI
  • Why you should avoid using Group in SwiftUI

Enjoy this week's SwiftLee Weekly!

THIS WEEK'S BLOG POST

SwiftUI TabView: Explained with Code Examples

A standard TabView in SwiftUI isn't that interesting, but have you already played around with the sidebarAdaptable style and sections? I love how easy it has become to create this kind of navigation.

SPONSORED

Capture, Debug, and Optimize Your HTTP(s) Traffic in One App

Need to capture your HTTPS network? Try Proxyman! 1 click to work with iOS Simulator, Android Emulators, and other devices. Get started.

CURATED FROM THE COMMUNITY

SwiftUI Default Scroll Anchor

Do you recognize the scenario where you want to center content vertically in a scroll view if the size of the view is small enough to disable scrolling? The solution is shared in this article.
useyourloaf.com

ModelActor is Just Weird

One wish I have for WWDC is more in-depth documentation for SwiftData. There are just too many assumptions we need to make and unexpected behavior to deal with.
massicotte.org

Detecting body poses in a live video feed

Imagine detecting body poses in a live video feed 10 years ago. This is one of those articles that makes you realize how advanced today’s APIs are, including the Vision framework APIs.
createwithswift.com

Announcing FlowNavigation

I love creative solutions to navigation and I haven’t seen something like FlowNavigation before. The framework is still in beta, but the idea is promising for linear flows.
magnuskahr.dk

Why I Avoid Group

I’ve been using groups without thinking until I read this article by Chris Eidhof this week. I had no clue these differences existed!
chris.eidhof.nl

SWIFT EVOLUTION

An overview of last week's Swift Proposal state changes. Check them out when they're in review, as it's your opportunity to influence the direction of Swift's future.

Monthly giveaway

iOSKonf Conference Ticket Giveaway winner

I'm happy to announce D. Barmin as this month's giveaway winner! We'll contact you personally. For all others, thanks for joining! If you haven't yet, get your ticket here, and stay tuned for the next giveaway.

CODE SNIPPET OF THE WEEK

Region-based isolation in Swift Concurrency

I was quite surprised when I first encountered this. I expected compiler errors about my type not being sendable, but it turns out the Swift compiler is pretty smart! Honestly, I was also surprised since my experience so far has been many compiler errors during migrations. Knowing that Swift does a lot only to send diagnostics when truly needed is super helpful!

You can find this post on Twitter/X, LinkedIn, or Bluesky.

twitter profile avatar
Antoine v.d. SwiftLee 
Twitter Logo
@twannl
12:54 PM • Mar 24, 2025
1
Retweets
8
Likes

QUESTION OF THE WEEK

I've encountered quite a few flaky tests when testing async/await logic. Do you know how to solve this?

Flaky tests are annoying and can easily take time to solve. A flaky test is one that sometimes succeeds and sometimes fails. For example, it could succeed when running solo but fail once executed in parallel with other tests.

The latter is an example where there's likely shared state applied: your test uses shared data modified by another test running in parallel.

If that's not your case, you might encounter a so-called race condition—depending on the order and speed of the test, your test might run into a failure or not. This won't happen easily when running tests serially, but can suddenly appear when you migrate your test suite to run in parallel.

If you've recently migrated to Swift Testing, you're now likely running tests in parallel. It might very be that you didn't before and that you're now running in unexpected test failures. Swift Testing runs tests in parallel by default, making your code more likely to be affected by race conditions.

You can resolve flaky tests by using Test Repetitions in Xcode, but that might not be enough when testing Swift Concurrency code. For this, I highly recommend using a main serial executor. Looking for more? My Swift Concurrency course will cover testing in-depth.

Want to have your question answered next week? Ask your question via this form (anonymously) or reply to this email with your question.

{% if subscriber.rh_reflink != blank %}EARN ROCKETSIM LIFETIME

Enjoying this newsletter? Could you help me reach more Swift developers?

I'd love to grow this newsletter further, and your help could make a huge difference. I reach many developers via my socials, but word of mouth is hard to match.

You'll get several rewards along the way in return, but it's also a way for you to show your support for all the content I deliver weekly for free.

Sharing to socials can be done by clicking on any of these links: X/Twitter, LinkedIn, Bluesky. Or, probably even easier, you can share the following link in one of the Slack groups you're in:

{{subscriber.rh_reflink}}

No worries if you don't, but if you do, I absolutely appreciate it!{% endif %}

Thank you so much for your support, and until next Tuesday,

Antoine