This works for me...
if !DataController.isUITesting {
_container.viewContext.undoManager = nil
_container.viewContext.shouldDeleteInaccessibleFaults = true
do {
try _container.viewContext.setQueryGenerationFrom(.current)
} catch {
fatalError("###\(#function): Failed to pin viewContext to the current generation:\(error)")
}
}
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: