Issue 49
Apr 22, 2021

Swift 5.4 and a new Xcode beta are fun but they also require you as a developer to stay up to date and be aware of new features.

It's one of the most challenging parts of being a developer: staying up to date. Writing a weekly blog post is definitely a great way to dive into new Swift features and make yourself aware of new APIs. However, this might be a bit too much for everyone.

A simple thing you could do is open up a playground in Xcode 12.5 and start writing some of the new APIs. It's fun, and a great way to better understand what's possible. Don't hesitate to just copy over code from blog posts to make it come alive.

Just remember: you can't know everything. Make it a fun experience and don't push yourself too much. I'm still Googling every single day.

Enjoy this week's SwiftLee Weekly!

THIS WEEK'S BLOG POST

Before writing this article I didn't really have a clue on when and how to use function builders. Now that they're implemented in Swift 5.4 as result builders I really took time to understand their value and realized how powerful they can be. Using a real-case example for an autolayout improvement I did, I hope to convince you as well.

SPONSORED

Although you can create an app simply by throwing some code together, without best practices and a robust architecture, you’ll soon end up with unmanageable spaghetti code. Learn how to create solid and maintainable apps with fewer bugs using this free guide.

ENHANCING THE iOS SIMULATOR

This week’s update of RocketSim improves the performance quite a bit. Several caching layers make it possible to execute actions up to twice as fast. A refactor that was needed to prepare for RocketSim 4.0 which is currently in the making!

TWEET OF THE WEEK

Enums can simplify things and make it easier to reason about what kind of View your instantiating. I like this idea by Craig, which defines each possible modal usage in an enum.

CURATED FROM THE COMMUNITY

CODE

Even if you’re not using Combine this is worth a read. I really like the implementation of Marin Todorov using an unfair lock in combination with a result builder. If you are using Combine, you might find this useful to use.
While we’re covering many of the new Swift 5.4 features this one from John Sundell couldn’t miss. It might be one of the smaller changes but it’s good to be aware that this is now valid Swift code.

OPTIMIZATION

If there’s one shortcut I missed lately it has to be this one. Lee Kah Seng explains to us how we can re-enable it and benefit from it again when working on animations.
Another great feature shipping in Xcode 12.5 is playground access to app types. It basically means you can play around with your app’s code! Keith Harrison does a great job explaining what this means and how it works in the current beta.

INTERVIEW

If you’re an Apple fan you’re probably going to enjoy reading this interview. I enjoyed reading it both for the story as well as the experience that came with reading this together with contextual images.