WWDC 2021: State of the Union Recap
Tags: swift, wwdc, news, ios
Published: 2021-06-13 22:53:56

<p>
Here’s a quick recap of Apple’s State of the Union at WWDC (World Wide Developer Confrence 2021). You can find the <a href="https://developer.apple.com/videos/play/wwdc2021/102/?time=2036">full video here</a>.
</p>
<video width="320" height="240" controls>
  <source src="https://devstreaming-cdn.apple.com/videos/wwdc/2021/102/9/185FF8CB-65B8-468D-9AF3-E6B6444F9AB7/cmaf.m3u8" type="video/mp4">
Your browser does not support the video tag.
</video>

<p>
<h2>XCode Build</h2>

<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c0d2h1765otfujio9z7h.png" width="" alt="alt_text" title="image_tooltip">
</p>
 
<p>
A new continuous integration and delivery service built right into Xcode and hosted in the cloud, Xcode Build is Apple’s take on simplifying the process of building an app while helping you focus on what’s important. It helps you offload your builds, test, and code signing for distribution. It publishes your result right back into Xcode’s report navigator so you never have to switch context out of where you are building your app. 
</p>
<p>
One cool feature is that you can have the build notify you when it completes and publish it to your Slack or any other service. There is also a public API that you can dive into for grabbing information about your builds. I can see how building apps this way is way more integrated and convenient. This actually seems like a fun way to write tests for your app!
</p>
<p>
Code reviews also look to make massive improvements on commenting and reviewing code. The new views allow you to select between multiple ways to see what code has changed, and even view comments as you are fixing any potential bugs. Anyone who does code reviews how confusing it can get when there are multiple revisions and files removed or added to a pull request. 
</p>
<p>
<h2>Swift Concurrency Support</h2>
</p>
<p>
Most developers and engineers are used to the idea of writing concurrent code as it’s such a vital part of making fast and responsive code. 
</p>
<blockquote>
<a href="https://developer.apple.com/videos/play/wwdc2021-102/?time=1209">Concurrency enables your apps to perform multiple tasks at the same time, which helps your apps stay responsive to user input while doing work in the background, like a weather app fetching forecast data while the user selects a city.</a>
</blockquote >
<p>
The problem? Swift never had native support for concurrent code, so it was unnecessarily difficult to write good concurrent code. Apple’s new approach to this is <strong>Structured Concurrency</strong>. Actors are an industry standard and are vital to safe concurrent programming. 
</p>
<blockquote>
<a href="https://developer.apple.com/videos/play/wwdc2021-102/?time=1483">Conceptually, an actor is an object that protects its own state by only providing mutually exclusive access. This completely eliminates concurrent access and the low-level data races that come with it. </a>
</blockquote>
<p>
Actors’ are now a first class citizen in Swift and have a much simpler declaration:
</p>
<p>

<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x29vjw5swqvo40hn01xd.png" width="" alt="alt_text" title="image_tooltip">
 

</p>
<p>
Another benefit is MainActor, which lets you decorate a function to always run on the main thread. This is vital for API calls that are needed for the UI.
</p>
<p>

<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vket45ofwyu1gd9qunvw.png" width="" alt="alt_text" title="image_tooltip">

</p>
<p>
<h2>Swift Playgrounds</h2>
</p>
<p>

<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v1usqhckjjdwl88fkn5r.png" width="" alt="alt_text" title="image_tooltip">
 
</p>
<p>
This year, Swift playgrounds 4 allows you to work on your ideas wherever you go. It allows you to switch between Playgrounds and Xcode. Once you have created an app, you can even publish your app to TestFlight right from the Playgrounds app. 
</p>
<p>
<h2>VR and AR Kits</h2>
</p>
<p>

<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4l1bqcsnu0jfy4j1papb.png" width="" alt="alt_text" title="image_tooltip">
 

</p>
<p>
You can now add cool effects to your AR objects with Custom metal shaders and dynamic textures. You can see these effects in the Birthday Cake demo with confetti falling around the object.
</p>
<p>
<h2>Metal Improvements</h2>
</p>
<p>

<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dp17f09ljn1edukc5r30.png" width="" alt="alt_text" title="image_tooltip">

</p>
<p>
One thing that stood out to me as a Game Engineer is that you can now have more control over the display refresh rate. Especially if you are developing games that are going to run on the IPad Pro with ProMotion or on Macs that are connected to high end monitors, having control over the refresh rate can be useful for making your game look like it’s running smoothly!
</p>
<p>
Game controller support is also easier to add now, with haptic support. You can add a new on screen controller with only a few lines of code. 
</p>
<p>
<h2>Notifications</h2>
</p>
<p>

<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jkyhks52rdqbb2zrqcvh.png" width="" alt="alt_text" title="image_tooltip">

</p>
<p>
iOS is now changing how notifications work and at what level they are delivered. Focus allows the user to select what types of notifications are delivered. There are now 4 levels of notifications: Low, Active, Time Sensitive, and Urgent. Notifications summary allows users to get a brief overview of what was delivered with some marks of relevance. 
</p>
<hr>
<p>
There was lots more covered, but those are the highlights that stuck out to me. <strong>Let me know what you found interesting in the comments below!</strong>
</p>