diff --git a/pass/AppDelegate.swift b/pass/AppDelegate.swift index 6c18228..08e1a7a 100644 --- a/pass/AppDelegate.swift +++ b/pass/AppDelegate.swift @@ -23,7 +23,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { lazy var passcodeLockPresenter = PasscodeLockPresenter(mainWindow: self.window) func application(_: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - PersistenceController.shared.setup() // Override point for customization after application launch. SVProgressHUD.setMinimumSize(CGSize(width: 150, height: 100)) passcodeLockPresenter.present(windowLevel: UIApplication.shared.windows.last?.windowLevel.rawValue) diff --git a/passKit/Controllers/CoreDataStack.swift b/passKit/Controllers/CoreDataStack.swift index 29dbd1f..0452259 100644 --- a/passKit/Controllers/CoreDataStack.swift +++ b/passKit/Controllers/CoreDataStack.swift @@ -25,10 +25,13 @@ public class PersistenceController { description?.shouldInferMappingModelAutomatically = false if isUnitTest { description?.url = URL(fileURLWithPath: "/dev/null") + } else { + description?.url = URL(fileURLWithPath: Globals.dbPath) } + setup() } - public func setup() { + func setup() { container.loadPersistentStores { _, error in if error != nil { self.reinitializePersistentStore() diff --git a/passKitTests/CoreData/CoreDataTestCase.swift b/passKitTests/CoreData/CoreDataTestCase.swift index 8b3958c..fa356bf 100644 --- a/passKitTests/CoreData/CoreDataTestCase.swift +++ b/passKitTests/CoreData/CoreDataTestCase.swift @@ -21,7 +21,6 @@ class CoreDataTestCase: XCTestCase { try super.setUpWithError() controller = PersistenceController(isUnitTest: true) - controller.setup() } override func tearDown() {