SpacePod 34 CoreData Unique Attributes
Let’s ensure that all database entries are unique.
Steps
- Add a constraint and change it to
date
- Add
container.viewContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy
to Persistence init
Persistence.swift
...
container.viewContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy
...