Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

Issue 53
Mar 09, 2021

Stay updated with the latest in Swift & SwiftUI

The 2nd largest newsletter in the Apple development community with 18,593 developers. Don't miss out – Join today:


WWDC 2021 is likely going to be announced soon. Compared to the last few years, it's likely going to happen this week:
  • 2016: April 18
  • 2017: February 16
  • 2018: March 13
  • 2019: March 14
  • 2020: March 13
The big question is: will it be in-person or not? The second big question: would be feel bad if it isn't in-person?

I really enjoyed last year's online edition, and I think WWDC has never been so inclusive for everyone around the world. No $1500 ticket is required, and every session can be watched whenever you want. On top of that, each session was short, to the point, without technical issues.

It didn't bring parties, the bash, and meeting a lot of new friends. I doubt whether this year will be in person, but if there's one thing I wish for next year: an in-person WWDC with parties, a bash, and the same style sessions available for everyone.

Enjoy this week's SwiftLee Weekly!

THIS WEEK'S BLOG POST

@autoclosure is a magic keyword and transforms a closure into a regular argument. It's part of the family of lazy computation: lazy properties and lazy collections. If you wonder why that is the case, you might want to read this week's blog post.

Why you should read this: Your debugLog method is probably wrong

SPONSORED

With new essays, more code, extended content, and full support for Swift 5.0, the latest Swift Algorithms Book blends modern code, illustrations, and computer science to help you pass the interview or build your next app. Use discount code SWIFTLEE at checkout to receive 20% off.

TWEET OF THE WEEK

Combine arrived in iOS 13 and is since becoming more and more popular. Retain cycles, however, can occur easily if you don’t know what you’re doing. Point-Free helps us with a little tip on that matter in combination with animations in SwiftUI.

CURATED FROM THE COMMUNITY

CODE

Although I’ve never found myself in the need of working with C libraries, I do know others occasionally do need to work with them. Tibor Bödecs explains how you can make use of such a library using Swift Package Manager.
UIMenu always makes me wonder whether it should be part of mobile UI. On the other hand, it’s integrated, and I’m using it a lot! Still, it hasn’t been part of our set of UI in the Collect app… I guess I go a bit back and forth with this one, but Filip Němeček at least makes sure to got us covered once we start using it.
Async/await has been discussed quite a lot lately, and this proposal regarding structured concurrency deserves just as much if you ask me. It reminds me a lot of working with NSOperations and feels like a great addition to the upcoming changes in Swift. Currently in Active Review.
Deeplinking, Navigation, Routing, and SwiftUI: it’s always food for thought and conversations. Daniel Peter brings us a library that might solve this by providing APIs to create advanced navigation patterns based on navigation paths.
I really doubt whether I would ever use this in a real project as it might feel like magic without the right context, but it’s definitely an inspiring piece of code!
I was happy to see this blog post by Khoa as I’ve been creating many NSWindows lately for RocketSim, but none of them are written in SwiftUI. With the content of this article, I’m sure I’ll revisit my implementation.

OPTIMIZATION

This document has been around for a long time, but I’ve never found it before. It’s full of tips for writing high-performance Swift code. Don’t change your whole project following this document but try to learn and improve along the way in the long-term.
I really liked this article from Noah Martin, co-founder of the tool Emerge, which helps you save storage and reduce iOS app size. Structs vs. Classes has always been a nice discussion, and with this post, we have another reason to think about using structs over classes.
I’ve been beta testing the latest version of Kaleidoscope and really enjoyed their Xcode Debugger integration. It takes a bit of time to become part of your workflow, but I encourage you to check it out, as it might become helpful during debugging.

STORY

Now and then, Andy Ibanez moves away from technical posts to share a story. From being an iOS developer in Bolivia to learnings from selling an app.