Sponsored Link
Support Not only Swift: Sponsorship Opportunities Now Available
Exciting news! Not only Swift is now accepting sponsors.
If you love the regular insights I provide on Swift, SwiftUI, Firebase, AI, ML and other tech topics, you can now help sustain and grow this newsletter.
By becoming a sponsor, you'll reach a dedicated community of developers while supporting the creation of high-quality content that helps us all build better software.
Whether you're promoting a developer tool, framework, service, or event, your message will connect with passionate technologists.
Click the link below for details and the booking calendar.
Coming up

Adding Apple Intelligence to your app
So far, I've used mostly Google products and APIs such as Gemini, Vertex AI in Firebase, and Genkit to implement the AI features in my Second Brain app.
With Apple Intelligence soon to be available in the EU, let's take a look at adding some AI to Sofia using Siri, App Intents, and Spotlight.
Join me live and bring your questions!
Swift
Yielding and debouncing in Swift Concurrency
Especially when working with remote systems, latency compensation is an important technique to avoid thrashing the remote system and prevent race conditions on the client.
Frameworks like Combine and RX provide APIs like debounce
that make implementing this easier.
While SwiftUI itself doesn't have built-in debounce functionality, it seamlessly integrates with Combine for these reactive patterns. If you'd rather not want to use Combine, Majid explains how to implement debouncing directly using SwiftUI's task
view modifier combined with Task.sleep
.
He also demonstrates how you can use Task.yield()
to improve cooperative multitasking by creating suspension points that allow the Swift concurrency runtime to schedule other pending tasks.
The examples Majid provides focus primarily on how to execute code after a delay, but there's another common use case: preventing actions from occurring before a certain amount of time has elapsed. For instance, you might want to avoid marking an item as read until the user has viewed it for a minimum duration. Building on Majid's approach, here's how you can solve this challenge with a combination of the task view modifier and Task.sleep.
SwiftUI
Quick guide on home screen quick actions for SwiftUI
Quick actions enable users to access app functionality directly from the home screen by touching and holding the app icon. In this article, Tanaschita explains how to add quick actions, the differences between static and dynamic quick actions, how to localize them, and how to handle user interactions.
The article also contains a link to a hidden gem - debugging iOS features that require app start from external actions in Xcode.
BTW - do you remember 3D touch? Introduced in iPhone 6s, it used capacitive sensors to detect microscopic changes in the distance between the back light and the cover glass. Quite an engineering feat, but one that added extra complexity (and presumably weight) to the phone. Replacing 3D touch with haptic touch not only reduced production cost and weight (every little counts), but also improved overall reliability.
An Ode to Swift Enums: The View Models That Could
If you followed SwiftLeeds 2023, you will recall Jessie Linden's presentation on enums. In her talk, she showed how conforming enums to the View protocol can make your code easier to reason about.
Using enums as views is not the only way to get creative with this powerhouse of the Swift language: In this article, Jordan shows a different approach, and demonstrates how you can use enums as view models.
AI and ML

A visual introduction to machine learning
Is ML really just a series of "some if
statements"?
This visual introduction to machine learning demonstrates why not. Read / watch this on a large screen to really appreciate all the animations.

Visual Studio Code setup for iOS development with Copilot
If, after reading the article about Xcode phoning home, you'd like to try out a different IDE, here's another article about iOS development with VS Code.
Code
🫙🌶️ Spices
Need to add a debug menu to your app? Spices provides a property wrapper that is backed by NSUserDefaults
that makes this super simple. They even include a presentSpiceEditorOnShake
view modifier to trigger opening the menu by shaking the phone.
NeoShadow
NeoShadow provides advanced shadow effects for SwiftUI shapes, allowing you to create neomorphic UIs.
This reminded me a lot about Drams - Framer components inspired by Dieter Rams' design principles.
Anyone interested in re-creating those for SwiftUI?
How stuff works
Xcode constantly phones home
Ever wondered why Xcode is so slow, and what it spends so much time on when building your app? So did Jeff, and it seems like communicating with the Apple Developer website can cause this. Read his article to find out how you can prevent this (and if there are any risks to doing so).
VS Code - What’s the deal with the telemetry?
We’ve gotten used to the fact that many of the apps we’re using on a daily basis collect analytics data. So it shouldn’t be surprising that code editors and IDEs collect usage data as well.
This article dives into the telemetry system being used in VS Code, and provides a lot of pretty interesting background.
I found it pretty enlightening to learn that VS Code has an option that shows you exactly which data is collected.
Oh, and of course that blog post shows how you can disable telemetry collection altogether.
One more thing...
TypeScript types can run DOOM
If you thought running Doom inside a PDF file was crazy, wait until you see this.
I've been using Swift since it was originally introduced at WWDC 2024, but the creative uses people find for some of its features never ceases to amaze me. This week, we'll look at different ways how you can use enums - as views or view models. Using enums the way the language designers intended them seems a bit boring now...
I've also included a couple of articles about telemetry. Like most of you, I prefer to have the full power of my laptop at my disposal, and seeing it go to waste because some processes "phone home" definitely isn't great. On the other hand, telemetry data is crucial for understanding how certain features are used and how they can be improved.
I'm curious about your perspective - are you OK with apps and tools collecting usage data? Reply to this email to tell me your thoughts!
Peter