     }()
 
     private let modelName: String
-    
+
     public lazy var managedObjectContext: NSManagedObjectContext! = {
         var managedObjectContext = NSManagedObjectContext(concurrencyType: .MainQueueConcurrencyType)
         managedObjectContext.persistentStoreCoordinator = self.persistentStoreCoordinator
         return managedObjectContext
     }()
-    
+
     public lazy var managedObjectModel: NSManagedObjectModel = {
         let modelURL = NSBundle.mainBundle().URLForResource(self.modelName, withExtension: "momd")!
         return NSManagedObjectModel(contentsOfURL: modelURL)!
     }()
-    
+
     public lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator! = {
         // Enable for lightweight model migration
         var options = [String: AnyObject]()
         options[NSMigratePersistentStoresAutomaticallyOption] = true
         options[NSInferMappingModelAutomaticallyOption] = true
-        
+
         let coordinator = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel)
 
         var failureReason = "There was an error creating or loading the application's saved data."

            }
            return;
        }
        
        // Merge thread-related context into the main context
        self.managedObjectContext.mergeChangesFromContextDidSaveNotification(notification)
    }

    public func removeDatabase() throws {
        try NSFileManager.defaultManager().removeItemAtURL(storeURL)
    }
}

            var dict = [String: AnyObject]()
            dict[NSLocalizedDescriptionKey] = "Failed to initialize the application's saved data"
            dict[NSLocalizedFailureReasonErrorKey] = failureReason

            dict[NSUnderlyingErrorKey] = error as NSError
            let wrappedError = NSError(domain: "YOUR_ERROR_DOMAIN", code: 9999, userInfo: dict)
            // TODO: Replace this with code to handle the error appropriately.
