From b494698b687f808ca5838916fc9afddf15838787 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Thu, 21 Apr 2022 15:25:34 -0700 Subject: [PATCH] create background managed object context --- .../xcshareddata/xcschemes/Omnivore-iOS.xcscheme | 6 ++++++ .../Sources/Models/CoreData/StorageProvider.swift | 2 +- .../Sources/Services/DataService/DataService.swift | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/apple/Omnivore.xcodeproj/xcshareddata/xcschemes/Omnivore-iOS.xcscheme b/apple/Omnivore.xcodeproj/xcshareddata/xcschemes/Omnivore-iOS.xcscheme index da134da69..68e486e5a 100644 --- a/apple/Omnivore.xcodeproj/xcshareddata/xcschemes/Omnivore-iOS.xcscheme +++ b/apple/Omnivore.xcodeproj/xcshareddata/xcschemes/Omnivore-iOS.xcscheme @@ -76,6 +76,12 @@ ReferencedContainer = "container:Omnivore.xcodeproj"> + + + + () + + var viewContext: NSManagedObjectContext { + persistentContainer.viewContext + } + public var deletedHighlightsIDs = Set() public init(appEnvironment: AppEnvironment, networker: Networker) { self.appEnvironment = appEnvironment self.networker = networker self.persistentContainer = PersistentContainer.make() + self.backgroundContext = persistentContainer.newBackgroundContext() persistentContainer.loadPersistentStores { _, error in if let error = error {