Core Data
Dive deep into Core Data related topics, from basics to advanced implementations. Best practices explained with code examples.
How to observe NSManagedObject changes in Core Data using Combine
Observing changes in Core Data NSManagedObject instances with Combine publishers can be a great solution to keep your user interface ...
Data validation on insertion, update, and deletion in Core Data
Data validation in apps is important to make sure we save data conforming to the business rules. A name should ...
Derived Attributes to improve Core Data Fetch Performance
Derived attributes are available since iOS 13 and aim to improve fetch performance in many different scenarios. Although we have ...
Constraints in Core Data Entities explained
Constraints in Core Data are part of an entity configuration. Settings like the entity name and Spotlight display name might ...
NSManagedObject events: handling state in Core Data
An NSManagedObject lifecycle goes from insertion and updates until deletion in the end. All those events come with their own ...
How-to use Diffable Data Sources with Core Data
Diffable Data Sources were introduced at WWDC 2019 as a replacement for UICollectionViewDataSource and UITableViewDataSource. The API is available on ...
Persistent History Tracking in Core Data
WWDC 2017 introduced a new concept available from iOS 11 which is persistent history tracking. It's Apple's answer for merging ...
Write-Ahead Logging (WAL) disabled to force commits in Core Data
Write-Ahead Logging is the default journaling mode for Core Data SQLite stores since iOS 7 and OS X Mavericks. Journaling ...
ValueTransformer in Core Data explained: Storing absolute URLs
ValueTransformers in Core Data are a powerful way of transforming values before they get inserted into the database and before ...
Core Data Performance: 6 tips you should know
Writing Core Data code with performance in mind helps to prepare your app for the future. Your database might be ...
NSFetchedResultsController extension to observe relationship changes
Apple provides us with great classes like the NSFetchedResultsController to interact with Core Data databases in our apps. The API ...
Core Data and App extensions: Sharing a single database
Core Data got better and better over the years with improved APIs that make it easier to work with. The ...