Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

Issue 140
Nov 08, 2022

Stay updated with the latest in Swift & SwiftUI

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


The fun of sandboxed Mac applications.

Over the past weeks, I've been spending a lot of time improving the performance of RocketSim. While this had a huge impact, it wasn't an easy journey.

I requested a temporary exception for my App Sandbox Entitlement which resulted in RocketSim being in review for more than a week.

Gaining access to files outside your app's container requires users to give explicit access through NSOpenPanel. Once access is given, you need to store the URL with security scopes attached. However, how does this work when running executables outside your app binary?

RocketSim was up to 50% slower due to simctl creating xcresult files on failures. While it's a little chef's secret how this was solved in the end, you can guess that I found the solution by reading up on sandboxing in depth.

Although these are time-consuming challenges, I'm still happy to be in the Mac App Store. Yes, sandboxing isn't easy, but the reachability I gained through the Mac App store has been surprisingly high (350K. impressions in a single month). Lastly: all challenges I faced I've been able to solve even in a sandboxed environment.

Join me this Thursday at the free Mobile DevOps Summit to learn what's new in Swift 5.7.

Enjoy this week's SwiftLee Weekly!

THIS WEEK'S BLOG POST

While Swift 5.4 introduced the initial version of Result Builders, formally known as Function Builders, they improved quite a bit in recent Swift versions. Reason enough to dive into Result Builders and show you how to benefit.

SPONSORED

With a few lines of code, RevenueCat gives you everything you need to build, analyze, and grow in-app purchases and subscriptions without managing servers or writing backend code. Get started for free.

CURATED FROM THE COMMUNITY

SWIFT

I want to emphasize Apple recommends not checking for network connections and instead running requests and handling potential networking errors. However, the API covered by Danijela Vrzan can be helpful to pro-actively inform users about a bad networking condition without blocking any UI.

Sharing files between different extensions might not be as straightforward when you start. Marco Eidinger ‍ is here to help you out and explain how it works.

If you’re into animations, you will enjoy this journey from Bryce Pauken. He dives deep into animations, covering keyframe animations, CAReplicatorLayer, and more.

I was sad to read about DYLDPRINTSTATISTICS no longer working but became happy with the rest of the article Junda wrote. Keeping an eye on your app launch time is essential once your app becomes bigger. Once issues occur, you should be able to know how to solve them.

SWIFTUI

This article by Sarun W. teaches you that Apple’s documentation can be conservative, but it also gives insights into using StateObject initializers directly and how it can affect your apps.

After reading this article I realized I might need this solution from Jordan Morgan more than I thought. Learn how the appearance method in SwiftUI works and how you can use a custom modifier to only run code once.

EnvironmentObjects are great and give a lot of flexibility, but how does its lifecycle work exactly? Tiago Lopes decided to dive deep into this, including covering UIKit integrations.

APPS

Quite an exceptional app if you ask me, but I genuinely believe there’s value in using it. With the many layoffs lately, I bet there are more engineers like Marin Todorov back in the days searching for the jobs section on a website.

FEATURED SWIFTLEE JOBS

Join the SwiftLee Talent Collective if you're hiring mobile engineers or are open to exciting opportunities.
To check out more exciting opportunities or to post your job position: Check out the SwiftLee Jobs Board.

For companies
Get bi-weekly drops of world-class talented mobile engineers, open for new opportunities. Pre-market:  Many members of the SwiftLee Talent Collective haven't signaled anywhere else that they're open to new work.

For mobile engineers
Apply and receive attractive opportunities without obligations. If you will, your profile can stay completely anonymous, and you decide which companies to reply to. Read my tips to increase your chances of getting accepted as a talent.