How to keep SwiftData from crashing your app on ModelActor release and staged migrations

If you adopted SwiftData expecting a friendlier Core Data, you have probably already met one of its lifecycle traps: a @ModelActor instance going out of scope and taking your fetched models with it, a routine 0.9 → 1.0 staged migration failing with Cannot use staged migration with an unknown model version, or a CloudKit-synced store…

Modeling In-App Purchases Inventory

There are four types of in-app purchases in Apple’s App Store, with their own unique ways to manage it. The challenge is how to isolate the intricacies of these product types from the rest of the application. Otherwise a move from non-consumable in-app purchase to a subscription type would involve a major rewrite. Learn how to manage an app’s inventory of purchases and get the code base resilient to changes in the business side.