SwiftLee Weekly - Issue 243


This week's SwiftLee Weekly covers:

  • SwiftUI View Transitions
  • Expedited App Reviews
  • Debug SwiftUI Crashes

Enjoy this week's SwiftLee Weekly!

THIS WEEK'S BLOG POST

Mastering the @require Macro in Swift Testing

After covering the #expect macro before, we’re now ready to dive into its companion: the #require macro. While you don’t need it to write tests, it’s a game changer when it comes down to writing self-explanatory tests.

avanderlee.com

SPONSORED

Master Mobile Monitoring SwiftUI Apps

Monitor your app’s health with real-time insights into crash-free rates, start times, and more. Optimize performance and prevent user churn by addressing critical issues like app hangs, and ANRs. Learn how to keep your iOS app running smoothly across all devices by downloading this eBook.

CURATED FROM THE COMMUNITY

Creating View Transitions in SwiftUI

Explore the world of view transitions in SwiftUI with this comprehensive guide. Learn how to create smooth and engaging transitions between views, enhancing the user experience in your iOS apps. The article covers various transition types and provides practical examples to help you implement them effectively.

createwithswift.com

Minimal Manageable Migrations with Monarch

A new open-sourced framework called Monarch allows you to write efficient migrations. It’s hard to make your app’s data layer perfect for the future, so migrations are probably always needed at some point. This library might be a great outcome.

build.ms

Expedited App Reviews: When and How to Use Them

You might not even heard about expedited reviews before, but it’s a great escape route when a critical bug appears. This article provides valuable insights into when it's appropriate to request an expedited review, how to make a compelling case, and what to expect from the process.

polpiella.dev

Comprehensive Guide to Mastering KeyPath in Swift

Dive deep into the world of KeyPaths in Swift with this extensive guide. Learn how to leverage KeyPaths for more flexible and reusable code, understand their syntax and usage, and explore advanced techniques. This article is perfect for developers looking to enhance their Swift programming skills and write more efficient code.

fatbobman.com

Quick Design Feedback on your App

I’ve seen Hidde van der Ploeg do a live design roast at SwiftLeeds this month and he’s now turning this roasting into a service. It’s a great opportunity to get design critique and inspiration on how to improve your app.

tally.so

SWIFT EVOLUTION

An overview of last week's Swift Proposal state changes. Check them out when they're in review, as it's your opportunity to influence the direction of Swift's future.

QUESTION OF THE WEEK

How to debug crashes in SwiftUI?
Rajtharan Gopal

While this is a great question, it’s hard to answer completely. Each project is unique, and there are many different types of crashes. Therefore, I’d love to give a more generic answer to how I solve crashes.

Timeboxing is critical when solving crashes. You don’t want to lose yourself in a journey that doesn’t give you a quick solution. The first step would be to use AI or Google to find a fast way out. Yet, this is only possible if you clearly define the cause.

Ideally, you would be able to reproduce the crash quickly. I prefer writing a test for a crash so I can reproduce it consistently and promptly, but I also prevent the crash from returning unexpectedly in the future.

If you cannot find a quick way out, I recommend commenting out unrelated code and reproducing the crash with as minimal code as needed. This helps you to find the exact cause of the crash and likely enables you to define a better search query to find a solution.

At this point, it comes down to the type of crash. An EXC_BAD_ACCESS is common, and I wrote an article to help you solve it. Data races are also a common cause. Yet, SwiftUI-specific crashes might also relate to a particular OS version. In this case, you need to ensure you know the environment boundaries:

  • Am I running a beta that causes this? If so, check the release notes and validate whether the crash still happens on a release candidate version.
  • Is the crash consistently tight to a specific OS, country, app version, or anything else?

All these metrics combined help you reproduce the crash locally and solve it accordingly. Good luck; hopefully, these insights will help you solve crashes faster.

Want to have your question answered next week? Ask your question via this form (anonymously)

SwiftLee Weekly by Antoine van der Lee

SwiftLee Weekly keeps you up-to-date with the latest Swift Evolution proposals, delivers 5 handpicked articles from the community, and challenges your knowledge with a weekly question. Enjoy a monthly giveaway and dive into a fresh new article from SwiftLee every week. Plus, unlock $264 worth of exclusive discounts by subscribing.

Read more from SwiftLee Weekly by Antoine van der Lee

This week's SwiftLee Weekly covers: Concurrency step-by-step Geometry Effect in SwiftUI Reducing an iOS app's size by half Enjoy this week's SwiftLee Weekly! Oh, p.s., I'm finally on Bluesky. THIS WEEK'S BLOG POST Enum explained in-depth with code examples in Swift It's been a while since I wrote the first version of this article. Swift enums are well-known in their basics, but do you know how to use the fallthrough keyword? Or statements like guard case and if case? Now and then, I revisit...

This week's SwiftLee Weekly covers: Black Friday Discounts Apple Intelligence in SwiftUI Balancing support requests in side projects Enjoy this week's SwiftLee Weekly! THIS WEEK'S BLOG POST Black Friday: 50% discount on RocketSim & Going Indie Course It's that time of the year with crazy discounts floating around everywhere. I decided to join the madness and provide a 50% discount on my Going Indie course and RocketSim. Use this link to get a 50% discount on RocketSim Use this link to get a...

This week's SwiftLee Weekly covers: App Store Nominations ChatGPT for Xcode Lazy vars and observable classes Enjoy this week's SwiftLee Weekly! THIS WEEK'S BLOG POST Contingent pricing for in-app subscriptions Contingent pricing is close to one year old and still in the piloting phase. After joining forces with the team behind Helm, I wrote an article based on my experience integrating discounted subscription offerings using contingent pricing. SPONSORED Master Test Distribution & App...