Back to work

PacBag

Live

An iOS app that tracks what is in each bag and weighs it against the airline limit before you leave the house.

When
2025
My part
Sole author.
  • Swift
  • SwiftUI
  • Core Data
  • CloudKit

Free, no account, no server. 14,063 lines of Swift across 23 screens.

Building the data model in code

CoreDataManager constructs the entire Core Data model at runtime in 407 lines of Swift rather than loading a .xcdatamodeld file: 5 entities, 38 attributes, 12 relationships, handed to an NSPersistentCloudKitContainer.

CloudKit refuses a model that does not meet its constraints, and it refuses at launch rather than at compile time. Every attribute must be optional or carry a default, and every relationship must declare an inverse. Doing that by hand means 38 of 38 attributes set optionality explicitly, 29 carry defaults, and all 12 relationships name their inverse. Getting one wrong is a crash on first run, on a stranger’s phone.

What it does not have

No tests. The two test targets are unmodified Xcode templates, which is the honest state of it.

Version 1.0.1 is uploaded and waiting on Apple’s expanded age-rating questionnaire, so the App Store still serves 1.0.