 		}
 	}
 
+	var shouldMergeIncomingSavedObjects: Bool = true
+
+	deinit {
+		NotificationCenter.default.removeObserver(self)
+	}
 }
 
 

		moc.mergePolicy = (isMainContextReadOnly) ? NSRollbackMergePolicy : NSMergeByPropertyStoreTrumpMergePolicy

		mainContext = moc
	}

	var defaultStoreURL: URL {

	func setup(withDataModelNamed dataModelName: String? = nil, storeURL: URL? = nil, callback: Callback? = nil) {

		let url: URL
		if let storeURL = storeURL {	//	if the target URL is supplied
			//	then make sure that the path is usable. create all missing directories in the path, if needed
			url = storeURL
		} else {	//	otherwise build the name using cleaned app name and place in the local app's container
			url = defaultStoreURL.appendingPathComponent(cleanAppName).appendingPathExtension("sqlite")
		}
		let mom = managedObjectModel(named: dataModelName)
		let storeConfig = storeDescription

		self.storeURL = url
		self.dataModel = mom

		//	setup persistent store coordinators

		self.mainCoordinator = {
			let psc = NSPersistentStoreCoordinator(managedObjectModel: mom)
			psc.addPersistentStore(with: storeConfig, completionHandler: { [unowned self] (sd, error) in
				if let error = error {
					let log = String(format: "E | %@:%@/%@ Error adding persistent store to mainCoordinator:\n%@",
					                 String(describing: self), #file, #line, error.localizedDescription)
					fatalError(log)
				}
				//	now can setup main MOC
				self.setupMainContext()
			})
			return psc
		}()

		self.writerCoordinator = {
			let psc = NSPersistentStoreCoordinator(managedObjectModel: mom)
			psc.addPersistentStore(with: storeConfig, completionHandler: { [unowned self] (sd, error) in
				if let error = error {
					let log = String(format: "E | %@:%@/%@ Error adding persistent store to writerCoordinator:\n%@",
					                 String(describing: self), #file, #line, error.localizedDescription)
					fatalError(log)
				}
			})
			return psc
		}()

		//	setup DidSaveNotification handling
		setupNotifications()

		//	report back
		if let callback = callback {
			callback()
		}
	}


