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: How .ipa files can increase app security Optimizing user flows in apps Flexible SwiftUI user interfaces Enjoy this week's SwiftLee Weekly! THIS WEEK'S BLOG POST Swift Reduce: Combining elements into a single value Reduce is a typical functional pattern, a higher-order function that combines a collection into a single value cleanly and expressively. When I looked up how often I use it in RocketSim's codebase, I was quite surprised! Way more often than...

This week's SwiftLee Weekly covers: Structured spacing in SwiftUI Test scoping traits A great app that nobody knows about Enjoy this week's SwiftLee Weekly! THIS WEEK'S BLOG POST SwiftUI Alert Guide + Code Examples A SwiftUI alert can be presented in several ways. In this article, we explore these common view modifiers, changing the default action of an alert, and a convenient error-presenting extension I prefer to use in my projects. SPONSORED Transform Your Career with the iOS Lead...

This week's SwiftLee Weekly covers: What's new in Xcode 16.3 and Swift 6.1? Static vs. Dynamic dispatching New: RocketSim AI Enjoy this week's SwiftLee Weekly! THIS WEEK'S BLOG POST SwiftUI Grid, LazyVGrid, LazyHGrid Explained with Code Examples SwiftUI offers a Grid view, but it also comes with a LazyVGrid and LazyHGrid. Do you know when to use which? SPONSORED Discover the Top 10 Best Practices in App Distribution Appcircle seamlessly integrates the best app distribution practices into your...