Deprecation of enum CoreStore, reorganize global symbols

This commit is contained in:
John Estropia
2019-08-29 17:03:09 +09:00
parent 02d5bf85ae
commit 266b1a9913
95 changed files with 2232 additions and 1837 deletions

View File

@@ -43,7 +43,7 @@ extension NSManagedObjectContext {
return parentContext.parentStack
}
return cs_getAssociatedObjectForKey(&PropertyKeys.parentStack, inObject: self)
return Internals.getAssociatedObjectForKey(&PropertyKeys.parentStack, inObject: self)
}
set {
@@ -52,7 +52,7 @@ extension NSManagedObjectContext {
return
}
cs_setAssociatedWeakObject(
Internals.setAssociatedWeakObject(
newValue,
forKey: &PropertyKeys.parentStack,
inObject: self
@@ -71,7 +71,7 @@ extension NSManagedObjectContext {
#if os(iOS) || os(macOS)
context.observerForDidImportUbiquitousContentChangesNotification = NotificationObserver(
context.observerForDidImportUbiquitousContentChangesNotification = Internals.NotificationObserver(
notificationName: NSNotification.Name("com.apple.coredata.ubiquity.importer.didfinishimport"), // NSNotification.Name.NSPersistentStoreDidImportUbiquitousContentChanges (used string literals to silence deprecation warning)
object: coordinator,
closure: { [weak context] (note) -> Void in
@@ -103,7 +103,7 @@ extension NSManagedObjectContext {
context.mergePolicy = NSRollbackMergePolicy
context.undoManager = nil
context.setupForCoreStoreWithContextName("com.corestore.maincontext")
context.observerForDidSaveNotification = NotificationObserver(
context.observerForDidSaveNotification = Internals.NotificationObserver(
notificationName: NSNotification.Name.NSManagedObjectContextDidSave,
object: rootContext,
closure: { [weak context] (note) -> Void in
@@ -148,18 +148,18 @@ extension NSManagedObjectContext {
}
@nonobjc
private var observerForDidSaveNotification: NotificationObserver? {
private var observerForDidSaveNotification: Internals.NotificationObserver? {
get {
return cs_getAssociatedObjectForKey(
return Internals.getAssociatedObjectForKey(
&PropertyKeys.observerForDidSaveNotification,
inObject: self
)
}
set {
cs_setAssociatedRetainedObject(
Internals.setAssociatedRetainedObject(
newValue,
forKey: &PropertyKeys.observerForDidSaveNotification,
inObject: self
@@ -168,18 +168,18 @@ extension NSManagedObjectContext {
}
@nonobjc
private var observerForDidImportUbiquitousContentChangesNotification: NotificationObserver? {
private var observerForDidImportUbiquitousContentChangesNotification: Internals.NotificationObserver? {
get {
return cs_getAssociatedObjectForKey(
return Internals.getAssociatedObjectForKey(
&PropertyKeys.observerForDidImportUbiquitousContentChangesNotification,
inObject: self
)
}
set {
cs_setAssociatedRetainedObject(
Internals.setAssociatedRetainedObject(
newValue,
forKey: &PropertyKeys.observerForDidImportUbiquitousContentChangesNotification,
inObject: self