Intro to SwiftUI Concurrency
Add to favorites
Create a SwiftUI application using concurrent code and other new features introduced at WWDC21
Play video

SwiftUI Concurrency
1
Intro to SwiftUI Concurrency
9:09
2
AsyncImage and Date Format
14:07
3
Manage Content with Contentful
10:57
4
Apollo GraphQL
11:11
5
Fetching Data with Apollo
15:15
6
Data Modeling
11:57
7
Handle Dynamic Data
8:51
8
Featured Topic
11:10
9
Section Data
8:26
10
Pull Down to Refresh
5:38
11
Swipe Actions
6:56
12
Search Feature
9:44
13
Managing Modals
11:42
14
URLSession Data
11:34
15
Profile Card
8:37
16
Actors
7:01
17
Navigating Between Views
8:33
18
AttributedString
10:39
19
Localization with Contentful
10:09
20
Accessibility
11:32
WWDC21
WWDC21, or the 2021 Apple Worldwide Developers Conference, is an event that reunites Apple developers from all over the world where new features, new operating systems, and other new opportunities are discussed. You can watch the Keynote session, which highlights all the new innovations that are coming to all Apple products.
Some of the main points that were announced are iOS 15 and MacOS Monterey. Both of these operating systems are still in beta, and will be available to all in fall 2021. Two other talks are important to watch if you're an Apple Developer: What's new in SwiftUI and What's new in Swift. Let's take a look at the highlights of each of these sessions.
What's new in SwiftUI
WWDC21 introduced SwiftUI 3.0: A new version of SwiftUI that incorporates many features that were missing in earlier versions of the language. AsyncImage, the refreshable modifier, the searchable modifier and an updated library of SFSymbols are only a few examples of what's new in SwiftUI. We'll be covering a lot of these topics in this course. You can watch the whole session about What's new in SwiftUI here.
SwiftUI is now a powerful language that can build apps as complex as the Weather app, which has been rebuilt entirely in SwiftUI. It's now the perfect to learn this language!
What's new in Swift 5.5
Swift 5.5 has tremendous performance improvements: Builds are faster when changing imported modules, startup time is shorter, and fewer recompilations make builds' performance improved by a lot. Memory management is also been improved, and it is automatically managed by Xcode - we, developers, don't even need to think about it!
Concurrency, as mentioned above, is the hot topic. We'll dive deeper into the subject in future sections, but basically, concurrency means when we want to run multiple code at the same time and/or suspend some code while we wait for data to be fetched or downloaded.
We work with concurrency by using async await functions. We'll see how we can incorporate them in our code in future sections. If you're eager to learn all about concurrency, you can watch the What's new in Swift WWDC21 session, watch other WWDC21 sessions about concurrency, or read the entire article about Concurrency in Swift's documentation.
What you'll build
To make the most out of all the new features that were introduced at WWDC21, we'll be creating an application that deals with asynchronous functions. The best way to learn about async and await is to make network calls. Therefore, we'll be building a portion of the home view in our Design+Code iOS application. You can even download our application from the App Store, and learn design and code on the go!
The home view is a view loaded with data. We'll learn how to make use of Contentful, a Content Management System, to host our data on the cloud. Using Apollo GraphQL, we'll fetch that data from Contentful, and process it in our application in order to display the data in beautiful cards. All of this network call will be done using async/await and continuation.
We'll also learn how to implement new features that were added to SwiftUI 3.0: date formatter, pull down to refresh, swipe actions, search and AttributedString. Moreover, we'll make our app more accessible by enabling localization for our content, and adding labels and values to make our views more accessible for VoiceOver users.
This course will mostly focus on logic, backend and functions. We won't cover a lot of UI, so if you want to learn more about UI and animations, follow the new Build an app for iOS15 course or the Build an app with SwiftUI (Part 1, Part 2 and Part 3) course.
Requirements
This course was built with Xcode 13, iOS 15 and MacOS Monterey. It's important that you meet these requirements, as some newly introduced features are only available after iOS 15 and in Xcode 13. We also assume that you have some basic knowledge of SwiftUI and Swift. If you don't, I recommend you to follow the Build an App with SwiftUI Part 1, Part 2, Part 3, and SwiftUI Combine and Data to get a base of the concepts we'll cover in this course.
MacOS Monterey is still in beta as of this writing (June 2021). It's only available if you're under the Apple Developer Program (ADP), in the Downloads page and the Operating Systems tab.
For now, Xcode 13 is also only available for Apple Developers under ADP, on the same Downloads page and under the Applications tab. This comes with built-in iOS 15 support, and the Simulators will run on iOS 15. Async await functions also only works on iOS 15 and later, so it's important for you to have Xcode 13.
If you're not under the Apple Developer Program, MacOS Monterey is set to be released in fall of 2021. You can learn more about all the new exciting features that'll be available in MacOS Monterey on this page.
Create your project
Open Xcode, and create a new project. This project will target iOS, so select App under the iOS tab.
Give your project a name, and make sure that Interface is SwiftUI and Language is Swift.
Once your project is created, click on your Project name. Under Targets > Deployment Info, make sure that you select iOS 15.0, since we want develop for iOS 15.0 and later. If you don't, you'll need to wrap your code with if #available(iOS 15.0, *) for all new features that we'll cover, which makes the code harder to read.
Download Assets and Code
Make sure to download the source files of this course, as it contains assets and code that we'll need in the next sections.
- In the Assets folder, you'll find the Illustrations folder. It contains illustrations that we'll need in the Setting up Contentful section (section 3). You'll also find the App Icons set - add it to your Xcode project's Assets folder.
- In the Code folder, you'll find a few folders containing some files with code already written for you, for specific sections of this course. We'll get back to them later, you don't need to import them yet into your project.
- The Completed Project folder contains the final Xcode project of this course.
Upcoming
Great! We now created our project and are ready to code! In the next section, we'll cover some of the basic elements of the home view - that is, the date title with the new formatted(date:time:) method that formats date automatically for us, tab view and card components using AsyncImage.
Templates and source code
Download source files
Download the videos and assets to refer and learn offline without interuption.
Design template
Source code for all sections
Video files, ePub and subtitles
Videos
Assets
ePub
Subtitles
1
Intro to SwiftUI Concurrency
Create a SwiftUI application using concurrent code and other new features introduced at WWDC21
9:09
2
AsyncImage and Date Format
Load image remotely and display date in readable format
14:07
3
Manage Content with Contentful
Data modeling in Contentful
10:57
4
Apollo GraphQL
Connect data from Contentful using Apollo
11:11
5
Fetching Data with Apollo
Get data using async await and continuation methods
15:15
6
Data Modeling
Convert raw data into a data model
11:57
7
Handle Dynamic Data
Adding dynamic data into components
8:51
8
Featured Topic
Promote courses randomly on app launch
11:10
9
Section Data
Querying section data with Apollo GraphQL
8:26
10
Pull Down to Refresh
Refresh data on pull down drag gesture using refreshable
5:38
11
Swipe Actions
Pin and unpin list items
6:56
12
Search Feature
Search content with searchable modifier
9:44
13
Managing Modals
Show different views with a modal manager
11:42
14
URLSession Data
Integrating async await when sending HTTP request
11:34
15
Profile Card
Display profile information and open web link within the app
8:37
16
Actors
Prevent data races with actors
7:01
17
Navigating Between Views
Linking views and passing data
8:33
18
AttributedString
Styling text with AttributedStrings
10:39
19
Localization with Contentful
Translate content based on the device's preferred language
10:09
20
Accessibility
Improve accessibility with accessibility labels and values
11:32
Meet the instructor
We all try to be consistent with our way of teaching step-by-step, providing source files and prioritizing design in our courses.
Stephanie Diep
iOS and Web developer
Developing web and mobile applications while learning new techniques everyday
7 courses - 36 hours

Build Quick Apps with SwiftUI
Apply your Swift and SwiftUI knowledge by building real, quick and various applications from scratch
11 hrs

Advanced React Hooks Handbook
An extensive series of tutorials covering advanced topics related to React hooks, with a main focus on backend and logic to take your React skills to the next level
3 hrs

SwiftUI Concurrency
Concurrency, swipe actions, search feature, AttributedStrings and accessibility were concepts discussed at WWDC21. This course explores all these topics, in addition to data hosting in Contentful and data fetching using Apollo GraphQL
3 hrs

SwiftUI Combine and Data
Learn about Combine, the MVVM architecture, data, notifications and performance hands-on by creating a beautiful SwiftUI application
3 hrs

SwiftUI Advanced Handbook
An extensive series of tutorials covering advanced topics related to SwiftUI, with a main focus on backend and logic to take your SwiftUI skills to the next level
4 hrs

React Hooks Handbook
An exhaustive catalog of React tutorials covering hooks, styling and some more advanced topics
5 hrs

SwiftUI Handbook
A comprehensive series of tutorials covering Xcode, SwiftUI and all the layout and development techniques
7 hrs