blog.iankulin.com

Data

Updating stored JSON due to a struct change

A short walkthrough of migrating persisted app data in a Swift app after changing a Codable struct: I copy the old struct under a versioned name, and init() attempts to decode saved JSON with the new model first, falling back to the old one and converting items across. I note the migration code is deliberately messy and temporary, since the app only exists on my phone and a couple of simulators...

Musings on Data

Losing some enthusiasm for my online SwiftUI course, I weigh starting on app ideas from my notebook instead. The main gap in my knowledge is data persistence, so I consider the options: Core Data with CloudKit, Firebase, or simply writing files to the app sandbox, noting that a background in large relational databases means adjusting my thinking for small-scale apps. Whether to push on with the course or start building is left undecided...