June 2021: What’s new in the Swift Community?

June 2021: What’s new in the Swift Community?

In this article we cover the most interesting releases at WWDC 2021 and how the Swift community is starting to create new content around it.

Obviously, June is always the most critical month of the year for any Apple aficionado and the entire Apple developer community due to the annual worldwide developer conference. WWDC 2021 was the second all-digital conference after the switch to a remote event in 2020 due to the COVID-19 pandemic.

With over 200 sessions, more opportunities for one-on-one lab appointment with Apple engineers and specialists than ever, as well as the newly introduced digital pavilions on Slack, WWDC 2021 was certainly the most extensive and most accessible conference up to date with tons of new APIs introduced and upcoming versions of iOS, iPad OS, watchOS, tvOS and macOS being released as beta alongside Xcode 13.

Whether you enjoyed WWDC more than ever or long for an in-presence conference in the future, there are tons of new things to explore for the next few months, so here are some of the articles from within the developer community about the latest features of Swift 5.5, new capabilities in SwiftUI or some of the newly released APIs.

These are some of our favorite session from WWDC 2021:

Add rich graphics to your SwiftUI app, showcasing how to design beautiful, edge-to-edge graphics with super fancy materials and vibrancy options. In Jacob Xiao's words, "use tastefully".

Demystify SwiftUI, the most comprehensive look at the underlying mechanics of SwiftUI and its philosophy of Identity, Lifetime, and Dependencies.

"Are these two different dogs? Or are these, in fact, two pictures of the same dog? The truth is, it's impossible to say! We just don't have enough information." Matt Ricketson

Build interactive tutorials using DocC, introducing the powerful ability to craft immersive tutorials with rich instructions, example code with DocC that look just like those on the Apple Develop Documentation.

What are your favorites?

Swift 5.5

Alongside WWDC 2021 Swift 5.5 was released and even though the evolution of the language can be followed on swift.org, a lot of content was released by Apple to showcase new language features, most critically surrounding structured concurrency with async/await, actors, throwing properties, and extended property wrappers.

For a great summary of new features, we recommend "What's new in Swift 5.5?" by Paul Hudson that eloquently covers what is and what isn't new in Swift.

The async/await feature can certainly be seen as the star of the show at WWDC 2021 and completely shifts how to deal with concurrency in Swift. Moving away from completion handlers and hard-to-read code blocks, developers can now await the results of asynchronous tasks with safer and much easier-to-read code. For an easy-to-understand tutorial about async/await, follow the "Introduction to async/await in Swift" by Tibor Bödecs that he also extends towards Server Side Swift with his "Beginner's guide to the async/await concurrency API in Vapor & Fluent". To integrate the new async/await features to other parts of your existing code, consider John Sundell's "Connecting async/await to other Swift code" to develop a strategy for your project as they transition towards new Swift language features.

Actors are a new object in Swift 5.5 that isolates access to its mutable state, by requiring read or write access to be conducted asynchronously for any method that relies on the mutable state. This new concept allows to solve data races and makes dealing with concurrent tasks much easier than before. For a more in-depth exploration of Actors, refer to "An introduction to synchronizing access with Swift’s Actors" by Donny Wals. For more hands-on exploration, consider the "Swift actors tutorial - a beginner's guide to thread-safe concurrency" by Tibor Bödecs.

Also, the new concurrency features in Swift 5.5 have some implications for the Combine framework, aimed at managing asynchronous events by combining event-processing operators. Some interesting thoughts are shared by John Sundell in "What Swift’s new concurrency features might mean for the future of Combine".

SwiftUI

Updates to SwiftUI, Apple's declarative framework for interface and interaction design, were certainly most anticipated for WWDC 2021. The framework is just three years old and has certainly matured to a production-ready environment even in 2020. It comes with powerful new features such as a new AsyncImage view for loading remote images, pull to refresh for list views, a new search bar feature, custom swipe actions, new visual effects, keyboard toolbars, and deep integration of new asynchronous features of Swift.

For a great introduction to all the new features in SwiftUI and step-by-step instructions for literally anything new, we recommend "What’s new in SwiftUI for iOS 15" by Paul Hudson. Also, Majid Jabrayilov covered "What is new in SwiftUI after WWDC21" with special attention to list views and the new searchable modifier. Of course, there is also the refreshable modifier that introduced native support for the popular pull-to-refresh interaction with SwiftUI. It is also powered by async/await and can be tailored with custom logic and error handling. For this, consider "Making SwiftUI views refreshable" by John Sundell.

In regard to using the newly introduced concurrency features of async/await to Core Data and use them with SwiftUI, Donny Wals also shared some thoughts in "WWDC Notes: Bring Core Data concurrency to Swift and SwiftUI" and "WWDC Notes: Discover concurrency in SwiftUI".

SF Symbols 3

Also, SF Symbols received a powerful update at WWDC 2021, not just increasing the variety and size of icons but also extending the ability to render multi-color icons. And it is safe to say, that they look gorgeous.

To get a grasp of the extensive possibilities provided by SF Symbols, we recommend The Complete Guide to SF Symbols by Paul Hudson which covers all techniques for both SwiftUI and UIKit and provides extensive sample code.

DocC Framework to document your projects

Another interesting release at WWDC 2021 is the DocC framework aimed at creating documentation from your codebase that looks native to the Apple developer ecosystem and integrates well with official documentation inside Xcode and can also be published on the web.

It is really a nice release. The Documentation Compiler is building on Markdown syntax to annotate source code to build documentation archives that can be used in Xcode, shared with others, and hosted on web servers. If you are curious, we recommend How to document your project with DocC by Paul Hudson to get started with the documentation of your next project.

Also, the DocC framework introduced a powerful way to create editorial articles as well as interactive tutorials alongside the source code documentation. This is great and illustrates the benefits of having editorial capabilities inside documentation to explain concepts and usage of technologies to its adopters. The interactive tutorials also come in handy and adopt the user experience of few excellent interactive tutorials created by Apple, such as Introducing SwiftUI or Bring an iPad App to the Mac with Mac Catalyst.

Looking ahead

We are super excited about the announcements at WWDC 2021 and can't wait to explore all the new APIs and features. We hope to release new articles on the latest features on Create with Swift upcoming, focussing on the latest and greatest of SwiftUI and the new async/await features.

If you are curious, join our no-strings-attached mailing list to be the first to know when new stuff is out.