This is an example of how to use Core Data without using Xcode's data model design tool. The Core Data models and migrations in this project are created completely in code.
I can. And shouldn't that be enough?
Apple explicitly mentions that it's possible in the Core Data Programming Guide, but doesn't provide any examples.
To better understand Core Data models and migrations.
Writing models in code, while it takes more time initially, is easier to diff. That means easier merging, clearer changeset history, and potentially saved time down the road.
On iOS, app writers are limited to static libraries for reusing code between apps. That complicates the bundling of compiled object models. By writing models in code, they are included directly in the .a file.
- I stopped short of making this an actual working app. After upgrading to the latest model, you won't be able to set the source for any recipes. I focused on the models and migrations.