SwiftLee Weekly - Issue 262


This week's SwiftLee Weekly covers:

  • Rendering Pixel Art in SwiftUI
  • .animation() vs. withAnimation()
  • An @Observable performance risk

Enjoy this week's SwiftLee Weekly!

THIS WEEK'S BLOG POST

Picker in SwiftUI explained with code examples

While AI greatly helps us, I always look for a quick visual overview of different SwiftUI element styles. This is why I'm writing about pickers in SwiftUI this week: to give a visual overview of the different available styles that I can revisit myself.

SPONSORED

Paywalls Made Easy – Superwall

Huge apps like PhotoRoom, Mojo & Citizen use Superwall to build paywalls without shipping app updates. Learn how.

CURATED FROM THE COMMUNITY

Rendering Pixel Art with SwiftUI

I didn’t know the interpolation modifier yet! While this is an edge case, it’s good for you to understand how to render tiny bitmaps.
twocentstudios.com

.animation() vs withAnimation(): what's the difference?

Without reading this article by Vincent Pradeilles: do you know the difference? If not, it’s time to give it a read!
swiftwithvincent.com

Creating App Intents using Assistant Schemas

App Intents are at the core of many iOS integrations. I even wrote about App Intent-driven development as I believe it can help you build apps faster. This article dives into assistant schemes.
createwithswift.com

Lazy Initialization @State in SwiftUI - Overcoming Premature Object Creation

Did you know the Observation framework isn’t always resulting in enhanced SwiftUI performance? The case described in this article Fatbobman is an important one to be aware of when using @Observable.
fatbobman.com

Synchronous Work

Swift Concurrency and suspension points: the moment you think you understand them, a new scenario appears. There are several proposals related to this article (and properly mentioned accordingly!), so things might change soon. Yet, this is a very educational article to help you better understand concurrency.
massicotte.org

MONTHLY GIVEAWAY

Win a ticket for iOSKonf'25

Win a ticket for iOSKonf '25, a conference taking place from May 13 to 15, in Skopje, North Macedonia.

Joining the giveaway is free—the winner will be announced in SwiftLee Weekly 264 (March 25th).

Join the giveaway

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.

CODE SNIPPET OF THE WEEK

Toggling Booleans

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

twitter profile avatar
Antoine v.d. SwiftLee 
Twitter Logo
@twannl
3:44 PM • Mar 10, 2025
1
Retweets
11
Likes

QUESTION OF THE WEEK

How would you explain async/await?

I'm probably in my concurrency bubble, but interest in this topic seems to be growing lately. Several new Swift Proposals aim for an easier concurrency approach (more on that next week) that feeds social media discussions.

The async/await syntax is part of the concurrency fundamentals and while working on my slides for AppDevCon, I reached out on socials to ask how you would explain this concept.

I asked ChatGPT for one-sentence metaphors:

  • Elevator Ride – You press the button (async), check your phone (await), and step in when the elevator arrives.
  • Coffee Machine – You press the button (async), do other tasks (await), and come back when the coffee is ready.

But I also received a few great ones on social media:

  • An asynchronous method needs to be awaited for its result
  • You have a team. Ask someone to do something. He will get back to you when the work is done. In the meantime, you're free to do something unrelated.

Everyone will have their favorite, and despite the many challenges concurrency brings, I'm convinced we'll get to a state in Swift where writing asynchronous code will be easier than we're used to with custom locking mechanisms and GCD-closure-based solutions. Make sure to check the proposal updates in this newsletter since exciting changes are coming. I'm personally monitoring them closely and look forward to writing a dedicated article to tell you all about it!

I'm open to new questions!
Ask your question via
this form (anonymously) or reply to this email with your question.

EARN ROCKETSIM LIFETIME

Share and Earn RocketSim Lifetime & a 1-on-1 coaching session

Apple has recognized RocketSim as an Essential Developer Tool in the Mac App Store, and now you can get lifetime Pro access by sharing your unique referral link!

How to get started:

[RH_REFLINK GOES HERE]

Rewards:

  • Earn your first reward after just 3 sign-ups!
  • Check your progress anytime using your referral dashboard.
  • The grand prize? A personalized 1-on-1 career coaching session!

Several subscribers have already claimed their rewards—will you be next?

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

Antoine

SwiftLee Weekly by Antoine van der Lee

A new SwiftLee article, code snippet, Swift Evolution updates, 5 top community articles, and a weekly answer to a question from the community to level up your Swift skills.

Read more from SwiftLee Weekly by Antoine van der Lee

This week's SwiftLee Weekly covers: Structured Concurrency? SwiftUI Animations Threading in Swift Concurrency Enjoy this week's SwiftLee Weekly! THIS WEEK'S BLOG POST What is Structured Concurrency? I'm working hard on my Swift Concurrency Course, and AppDevCon talk on concurrency. While Swift Concurrency can be daunting, it's often because we don't fully understand the foundational concept. A part of this is understanding what Structured Concurrency really means and how it helps us write...

This week's SwiftLee Weekly covers: Conference ticket giveaway Task.yield vs. Task.sleep What is a good course price? Enjoy this week's SwiftLee Weekly! THIS WEEK'S BLOG POST Task.sleep() vs. Task.yield(): The differences explained I've used both methods in my code, but sleep has always been easier to understand than Task.yield(). It's time to dive into the differences and showcase a few examples. SPONSORED Codemagic makes Apple M2 machines available, even on the free tier! Codemagic is the...

This week's SwiftLee Weekly covers: Swift 6 ScrollTargetBehavior protocol A major milestone for RocketSim Enjoy this week's SwiftLee Weekly! THIS WEEK'S BLOG POST Swift 6: What’s New and How to Migrate The release of Swift 6 caused quite some discussion for those migrating their projects. I've seen several conference talks with slides showing hundreds of warnings and compiler errors after initially switching to Swift 6 language mode. It's time to help you get started with the migration after...