From 642d15670ca03b2c50fbfa0abcd90a38e1ebf567 Mon Sep 17 00:00:00 2001 From: Dilip Parmar Date: Thu, 21 May 2020 17:14:18 +0530 Subject: [PATCH] minor fix for store path when store url is passed --- Sources/CoreDataWrapper/CoreDataWrapper.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/CoreDataWrapper/CoreDataWrapper.swift b/Sources/CoreDataWrapper/CoreDataWrapper.swift index af86406..fd408fe 100644 --- a/Sources/CoreDataWrapper/CoreDataWrapper.swift +++ b/Sources/CoreDataWrapper/CoreDataWrapper.swift @@ -140,7 +140,8 @@ final public class CoreDataWrapper { case .sqlite: debugPrint("\(self.storeType)"); fallthrough case .binary: if let storeURL = self.storeURL { - storeDescription.url = storeURL + let dbFileNameWithExt = self.databaseFileName + self.storeType.getStoreFileExt() + storeDescription.url = storeURL.appendingPathComponent(dbFileNameWithExt) } else { storeDescription.url = self.storeFullURL self.storeURL = self.storeFullURL @@ -170,6 +171,7 @@ final public class CoreDataWrapper { @available(iOS 12.0, macOS 10.13, *) final public func saveMainContext(isSync: Bool, completion: ((Bool) -> Void)?) { + debugPrint("called \(#function) at = \(Date())") let saveChangesBlock = { if self.mainContext.hasChanges { do { @@ -193,6 +195,7 @@ final public class CoreDataWrapper { final public func saveBGContext(context: NSManagedObjectContext, isSync: Bool, completion: ((Bool) -> Void)?) { + debugPrint("called \(#function) at = \(Date())") let saveChangesBlock = { if context.hasChanges { do {