There is probably an infinite number of ways to design a Core Data stack. One mistake that I’ve experienced in the past is nesting contexts like this:

There is probably an infinite number of ways to design a Core Data stack. One mistake that I’ve experienced in the past is nesting contexts like this:
I needed to cancel subscriptions (AnyCancellable
) made using sink inside the sink
closure without causing any leakage. It didn’t turn out to be straightforward. We’ll explore how I solved that here.
We will explore how to migrate between two Core Data model versions and delete one entity’s objects. We’ll do this using a mapping model and a custom migration policy.
Continue reading “Deleting Objects During a Core Data Migration” →We’ll explore how we can write unit tests for Core Data migrations. This approach should apply to both lightweight and heavyweight migrations.
Continue reading “Writing Unit Tests for Core Data Migrations” →There may be times when we’d like to evaluate the state of private properties in unit tests. But we’d rather avoid exposing them publicly as this could make the interface difficult to understand. One way to get around this using reflection via Swift’s Mirror
.