Donny Wals πŸ‘Ύ's Avatar

Donny Wals πŸ‘Ύ

@donnywals.bsky.social

iOS Engineer, blogger and author at https://donnywals.com. Loves learning and sharing knowledge. -- #swift #ios #swiftlang #iosdev #solopreneur (he/him)

2,211 Followers  |  473 Following  |  878 Posts  |  Joined: 24.05.2023  |  1.623

Latest posts by donnywals.bsky.social on Bluesky

What's new for concurrency in Swift 6.2
Swift 6.2 is now officially in beta and so it's time for me to talk about what's new in concurrency for Swift 6.2. This video is a companion for my blog post on the same topic: https://www.donnywals.com/exploring-concurrency-changes-in-swift-6-2?utm_source=youtube In this video you will learn about nonislated(nonsending), and how it will make nonisolated async functions run on the actor that they were called from by default. You'll learn why this matters, and how you can use @Concurrent to offload work to a background thread. You'll also see how you can enable this feature from within Xcode's build settings directly. After that, we'll take a look at the new concurrency default in Xcode 26 that will make all your code run on the main actor by default. You'll learn how you can control default actor isolation by either setting it to MainActor or nonisolated, and you'll learn how this simplifies the way your code works. We'll also talk about how you can opt-out of this feature on a type- and function level. Strengthen your iOS development skills with my books: https://gumroad.com/l/practical-combine?utm_source=youtube https://gumroad.com/l/practical-core-data?utm_source=youtube https://gumroad.com/l/practical-swift-concurrency?utm_source=youtube https://gumroad.com/l/practical-bundle?utm_source=youtube Timestamps 00:00 - intro 00:56 - function types in Swift 6.1 04:21 - calling functions from the main actor 07:53 - calling functions from the global executor 09:34 - introducing nonisolated(nonsending) 10:10 - demonstrating actor inheritance 11:12 - introducing @concurrent 15:46 - introducing default actor isolation 21:11 - summary What's new for concurrency in Swift 6.2

Dive into Swift 6.2's concurrency updates! Learn about nonisolated async functions, @Concurrent, and Xcode 26's new concurrency defaults. Boost your iOS skills with practical insights. Watch here: https://www.youtube.com/watch?v=7QvCFBNz45A

08.10.2025 12:52 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

A good morning and happy Monday, folks! Hope you're all having a good start of your week. Do you have any plans? Are you working on something cool? Learning something new? Anything at all, tell me all about it 😎

06.10.2025 09:52 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
What is @escaping in Swift? – Donny Wals If you’ve ever written or used a function that accepts a closure as one of its arguments, it’s likely that you’ve encountered the keyword. When a closure is marked as escaping in Swift…

Learn how escaping closures allow asynchronous operations and why they're essential for callback-based APIs. Dive into the nuances of variable capture in Swift to enhance your coding skills. More here: https://www.donnywals.com/what-is-escaping-in-swift/

26.09.2025 11:58 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Did you know that Approachable Concurrency in Xcode 26 enables a set of Swift features that make getting started with Concurrency much easier than it was before? Read about it here: https://www.donnywals.com/what-is-approachable-concurrency-in-xcode-26/

25.09.2025 15:20 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Do you know what Structured Concurrency is in Swift? If you're not exactly sure how Structured Concurrency fits in Swift's Concurrency model, catch up here: https://www.donnywals.com/the-basics-of-structured-concurrency-in-swift-explained/

25.09.2025 13:01 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
How to plan a migration to Swift 6?
Learn how you can start migrating over to Swift 6 in a responsible manner. Async/Await is super nice in Swift but at the same time it's essential that you plan a migration to Swift 6 carefully. With a completely new concurrency paradigm you'll run into tons of errors that are not familiar. It's rather easy to go overboard with the amount of concurrency that you're adding to your app, and you'll want to make sure that your team is up to speed when it comes to everything that's in Swift Concurrency. This video is a companion for my blog post on the same topic: https://www.donnywals.com/how-to-plan-a-migration-to-swift-6?utm_source=youtube Learn more about @preconcurrency and how it helps you migrate: https://www.youtube.com/watch?v=0Zf5zgtK-RU Improve your concurrency skills with my book, workshops, and course: https://practicalswiftconcurrency.com?utm_source=youtube https://donnyplus.com/p/practical-swift-concurrency-the-video-course?utm_source=youtube https://www.donnywals.com/workshops?utm_source=youtube Timestamps: 00:00 - Intro 01:03 - Taking inventory of your codebase 03:01 - Modularizing your codebase 04:25 - Strict concurrency checking 06:31 - Training your team 08:33 - Planning your approach 10:45 - Pitfalls and caveats 12:38 - Summary How to plan a migration to Swift 6?

Explore the essentials of migrating to Swift 6, find out what to expect and how you should prepare your team. Watch here: https://www.youtube.com/watch?v=YNBkp8L_j5M

25.09.2025 11:15 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

If you've ever felt like you weren't knowledgeable enough to participate in a conversation, so have I. And to be honest, I still feel that way regularly.

I reflect on this and more in this week's newsletter: https://www.donnywals.com/newsletters/4cHkurGuhPUE45uIhV4uVw/

25.09.2025 10:02 β€” πŸ‘ 3    πŸ” 1    πŸ’¬ 1    πŸ“Œ 1
Preview
Calculating the difference in hours between two dates in Swift Learn how to use date components to find the difference between two dates in Swift.

Learn to find the difference in hours between two dates in Swift using Calendar & DateComponents. Unlock practical insights to handle time calculations effortlessly. Check it out: https://www.donnywals.com/calculating-the-difference-in-hours-between-two-dates-in-swift/

24.09.2025 12:58 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Last week's blog post was a deep dive into unwrapping [weak self] in your Swift Concurrency Tasks and how common it is for folks to not introduce the behavior they were looking for: https://www.donnywals.com/how-to-use-weak-self-in-swift-concurrency-tasks/

24.09.2025 08:15 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

My blog post on Swift's actors hadn't seen much updates recently so I figured it could use some modernization. Check it out here: https://www.donnywals.com/actors-in-swift-explained-with-examples/

23.09.2025 13:34 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Asserting state with #expect in Swift Testing
Learn how you can ensure that your code is working as expected with the #expect macro in Swift Testing. You'll learn how to evaluate boolean conditions and ensure that your code throws the errors you expect, or that it doesn't throw errors at all. This video is a companion for my blog post on the same topic: https://www.donnywals.com/asserting-state-with-expect-in-swift-testing?utm_source=youtube Asserting state with #expect in Swift Testing

Enhance your Swift Testing skills! Discover using the #expect macro to verify code behavior, evaluate conditions, and handle errors seamlessly. Watch the video and dive deeper here: https://www.youtube.com/watch?v=tlw28ah_85I

23.09.2025 11:14 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Last week's video is a deep dive into some of the mistakes I frequently see when folks unwrap a [weak self] in their Swift Concurrency tasks...

See if you make the same mistake: https://www.youtube.com/watch?v=xpAj1xFyvGM

23.09.2025 06:02 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Building a backend-driven paywall with RevenueCat – Donny Wals Learn how you can use offer metadata to build a backend driven paywall with RevenueCat

Discover how to effectively integrate a backend-driven paywall using RevenueCat. Learn to manage products and entitlements seamlessly. Dive deeper here: https://www.donnywals.com/building-a-backend-driven-paywall-with-revenuecat/

22.09.2025 13:30 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

In last week's newsletter I wrote about how Swift 6.2 has me thinking about how frequently the code we write and the patterns we follow are the result of our own "default" behaviors rather than being fully thought out...

Read here: https://www.donnywals.com/newsletters/yVt9Cu8UsoCm892UaNZXaGUA/

22.09.2025 11:31 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Should you opt-in to Swift 6.2’s Main Actor isolation? – Donny Wals Swift 6.2 comes with some interesting Concurrency improvements. One of the most notable changes is that there’s now a compiler flag that will, by default, isolate all your (implicitly nonisolated)…

Main actor by default: yay or nay?

I wrote about my thoughts on the topic here: https://www.donnywals.com/should-you-opt-in-to-swift-6-2s-main-actor-isolation/

22.09.2025 10:13 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I'm convinced typos stay hidden until you hit send and can't make changes anymore, that's when they show themselves

22.09.2025 08:25 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

It's been two weeks since I've launched the Swift 6.2 update for Practical Swift Concurrency and folks seem to be enjoying the update a lot.

Huge thank you for everybody that's downloaded the book ❀️

https://gumroad.com/l/practical-swift-concurrency

22.09.2025 08:15 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

A good morning and a happy Monday, folks! Hope you've all had a nice weekend.

Do you have any plans for the week? Maybe learning something new, working on something cool, shipping something you've been working on?

Tell me all about it! 😎

22.09.2025 07:02 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 3    πŸ“Œ 0

You might be unwrapping [weak self] in your Tasks in a way that mitigates the reason you're using [weak self] in the first place. It's actually a pretty common issue that I've seen in several codebases...

Learn everything you need to know and more in t... https://www.youtube.com/watch?v=xpAj1xFyvGM

19.09.2025 15:37 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
What’s the difference between Float and Double in Swift – Donny Wals A and are both used to represent decimal numbers, but they do so in slightly different ways. If you initialize a decimal number in Swift using as shown below, the Swift compiler will assume that you…

Discover the difference between Float and Double in Swift. Learn how precision and memory usage vary and when to choose each type for your app development. Dive in: https://www.donnywals.com/whats-the-difference-between-float-and-double-in-swift/

19.09.2025 10:28 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

No because deinit will never get called until the task completes.

The guard let self at the start of the task makes a strong reference to self again.

One way to fix this is to unwrap self in the while loop instead. That way each iteration creates and releases its own strong reference

19.09.2025 05:42 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Decided to write up a version of this post that doesn’t involve sequences and solely focuses on issues that you can run into with having a weak self capture in a Task: www.donnywals.com/how-to-use-w...

18.09.2025 19:04 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Good catch! I’ll have a look at that

18.09.2025 18:59 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Donny Wals – The Newsletter I am a curious, passionate iOS Developer who loves sharing knowledge and learning. My goal is to help you master iOS development using Swift and Xcode through weekly blog posts and quick tips.

It's newsletter day! Check your inbox now to read why Swift has me thinking about my day-to-day behaviors...

If you're not subscribed, read the newsletter here: https://www.donnywals.com/newsletters/yVt9Cu8UsoCm892UaNZXaGUA/ (and don't forget to subscribe)

18.09.2025 18:52 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

Can you spot the issue with this code? There's a memory leak that I've seen introduced in many codebases.

In this week's post I explain exactly what the leak is, and how you can avoid memory leaks in tasks
https://www.donnywals.com/comparing-lifecycle-management-for-async-sequences-and-publishers/

18.09.2025 17:01 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 2    πŸ“Œ 1
Toggling the Swift 6 language mode in Xcode
With Xcode 16 you get access to the Swift 6 compiler. This compiler can compile your project in different language "modes". For example, Swift 5 mode which is the default mode for new Xcode projects. Your Swift packages however will use the Swift 5 language mode by default. In this video, we'll explore how you can set the Swift language mode in your projects and packages. This video is a companion for my blog post on setting the Swift 6 language mode for packages: https://www.donnywals.com/setting-the-swift-language-mode-for-an-spm-package/ Level up your Swift Concurrency skills today with my Concurrency course: https://donnyplus.com/p/practical-swift-concurrency-the-video-course Toggling the Swift 6 language mode in Xcode

Discover how to set Swift language modes in your Xcode projects. https://www.youtube.com/watch?v=WJ5DBo0RLrg

18.09.2025 11:56 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Generics in Swift explained – Donny Wals Learn what generics are in Swift using Array as an example. In this article I also show you how you can begin using simple generics in your apps straight away.

Explore Swift generics: enhance code reusability by working with different data types, and understand constraints to specify what types a function or class can work with. Get started here: https://www.donnywals.com/generics-in-swift-explained/

17.09.2025 13:18 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
How to decide between a Set and an Array in Swift?
Learn how you can decide between a Set and an Array in Swift. We go over their semantics as well as their core performance characteristics. Level up your Swift Concurrency skills with my video course: https://donnyplus.com/p/practical-swift-concurrency-the-video-course This video is a companion for my blog post about the same topic: https://www.donnywals.com/how-to-decide-between-a-set-and-array-in-swift/ How to decide between a Set and an Array in Swift?

Deciding between Set and Array in Swift? Learn their semantics and performance characteristics in this video. Discover practical tips to enhance your code. Watch here: https://www.youtube.com/watch?v=n4zSMfPBvJU

16.09.2025 12:50 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Solving "passing closure as a sending parameter" errors in Swift 6
Once you start your migration to Swift 6, you'll run into several hard to read, hard to understand, and hard to solve errors. In this video, we'll explore an error that reads: Passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure We'll also look at an error about "capturing a non-Sendable value in a Sendable closure". To learn more about concurrency, take a look at my course: https://donnyplus.com/p/practical-swift-concurrency-the-video-course or my book: https://practicalswiftconcurrency.com/ This video is a companion for my blog post on the same topic: https://www.donnywals.com/solving-reference-to-captured-var-in-concurrently-executing-code-in-swift?utm_source=youtube Solving "passing closure as a sending parameter" errors in Swift 6

Migrating to Swift 6? Encountering concurrency errors can be tricky. Dive into solving issues related to closures and the sending keyword: https://www.youtube.com/watch?v=PJJkKJOEsFI

12.09.2025 11:28 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Preventing unwanted fetches when using NSFetchedResultsController and fetchBatchSize When you use Core Data in a UIKit or SwiftUI app, the easiest way to do this is through a fetched results controller. In SwiftUI, fetched results controller is best used through the property wrapper.

Discover how to optimize Core Data with NSFetchedResultsController by setting a fetchBatchSize and handling unwanted fetches using predicates: https://www.donnywals.com/preventing-unwanted-fetches-when-using-nsfetchedresultscontroller-and-fetchbatchsize

11.09.2025 15:26 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@donnywals is following 19 prominent accounts