Gaston Mazzeo3 min

Swiftly Highlights: WWDC21 Wrap-up & Concurrency

EngineeringJul 8, 2021

Engineering

/

Jul 8, 2021

Gaston MazzeoiOS Engineer

Share this article

WWDC has come to an end, with a bunch of updates for the Apple development community. Let’s go through them in this new Swiftly Highlights edition!

iOS 15, iPadOS 15 & macOS MONTEREY

First of all, iOS 15 was revealed with some new goodies that we are excited to try out. SharePlay for FaceTime is a game-changer at a time when we're occasionally forced to be apart from our beloved family and friends. This new technology will allow us to stay connected to them by sharing our TV shows or music while on a call with them! And all this is possible thanks to the new GroupActivities API; it looks like it’s super easy to implement, so let’s see what we can build with it.

Regarding macOS Monterey, I think the coolest feature we’ve gotten is Universal Control. Of course, multiple apps can do that, but sharing your files by drag-and-drop between your Apple devices natively is awesome.

iPadOS 15 introduced Widgets and the App Library. Now you’ll be able to arrange and pin your favorite Widgets on your Home Screen between your apps.

But what we think is the best thing that we could have for this new OS is the release of Swift Playgrounds, which lets us use an iPad to create our SwiftUI app and even release it to TestFlight to share with our friends!

WWDC21 Wrap-up

Are there too many sessions, and you don’t know where to start? Well, Apple and Paul Hudson gathered their favorites, so you don’t need to struggle that much.

I highly recommend Demystify SwiftUI if you are interested in SwiftUI’s core tenets. It’s a nice session that helps you understand a bit more about SwiftUI to improve your apps.

One of this year’s WWDC highlights was the introduction of the Digital Lounges. The SwiftUI Lab shared his experience with them by curating some of the questions done during the sessions.

Talking about rumors... It looks like this WWDC edition foreshadowed the AR Glasses. They come with a bunch of little details, like Live Text, Visual Lookup and the new Maps with AR updates.

Besides this, Apple keeps introducing big changes for RealityKit, so I think we are not that far from tasting new AR experiences.

Last but not least, Apple posted a new section on their website, where you can find all the WWDC21 sample codes. So, if you are not much into sessions and you want to go straight to the code, that’s the best place to start.

Concurrency & Actors

This WWDC introduced Concurrency based on the Actor Model.

Data races usually occur when we try to read and write the same memory from multiple threads without being synchronized. Actors will help us to prevent these data races by creating synchronized access to its isolated data.

There is so much to say about this. We’ll highlight some podcasts and articles where you can get started.

John Sundell had the chance to discuss the topic with Doug Gregor from Apple on his podcast called Structured Concurrency. All of us should listen to this; it’s a nice way to learn about the motivations behind these new concepts.

The.Swift.Dev and Avanderlee posted some nice articles about how to get started, the main problem before using them and how you can refactor your code to make it thread-safe without much effort.

Concurrency and Actors are pretty related to asynchronous functions, a pattern commonly known as async/await — so a nice way to get into it is by watching the Meeting Async/await in Swift Session.

And as we all know, we always need to update our app’s UI on the main thread. But when we talk about concurrency, things can happen in background threads, so we have to make sure to jump back to the main thread before updating it.

But no worries. Since Swift 5.5, you can use the MainActor property wrapper to let your code know that things should always happen on the main thread. John Sundell explains how it works.

That’s it for June! Hope you enjoyed this WWDC wrap-up edition and see you next month!

Share this article