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

@@ -144,15 +144,15 @@ public enum TransformableContainer<O: CoreStoreObject> {
get {
CoreStore.assert(
Internals.assert(
self.rawObject != nil,
"Attempted to access values from a \(cs_typeName(O.self)) meta object. Meta objects are only used for querying keyPaths and infering types."
"Attempted to access values from a \(Internals.typeName(O.self)) meta object. Meta objects are only used for querying keyPaths and infering types."
)
return withExtendedLifetime(self.rawObject!) { (object) in
CoreStore.assert(
Internals.assert(
object.isRunningInAllowedQueue() == true,
"Attempted to access \(cs_typeName(O.self))'s value outside it's designated queue."
"Attempted to access \(Internals.typeName(O.self))'s value outside it's designated queue."
)
if let customGetter = self.customGetter {
@@ -163,19 +163,19 @@ public enum TransformableContainer<O: CoreStoreObject> {
}
set {
CoreStore.assert(
Internals.assert(
self.rawObject != nil,
"Attempted to access values from a \(cs_typeName(O.self)) meta object. Meta objects are only used for querying keyPaths and infering types."
"Attempted to access values from a \(Internals.typeName(O.self)) meta object. Meta objects are only used for querying keyPaths and infering types."
)
return withExtendedLifetime(self.rawObject!) { (object) in
CoreStore.assert(
Internals.assert(
object.isRunningInAllowedQueue() == true,
"Attempted to access \(cs_typeName(O.self))'s value outside it's designated queue."
"Attempted to access \(Internals.typeName(O.self))'s value outside it's designated queue."
)
CoreStore.assert(
Internals.assert(
object.isEditableInContext() == true,
"Attempted to update a \(cs_typeName(O.self))'s value from outside a transaction."
"Attempted to update a \(Internals.typeName(O.self))'s value from outside a transaction."
)
if let customSetter = self.customSetter {
@@ -226,7 +226,7 @@ public enum TransformableContainer<O: CoreStoreObject> {
internal let affectedByKeyPaths: () -> Set<String>
internal var rawObject: CoreStoreManagedObject?
internal private(set) lazy var getter: CoreStoreManagedObject.CustomGetter? = cs_lazy { [unowned self] in
internal private(set) lazy var getter: CoreStoreManagedObject.CustomGetter? = Internals.with { [unowned self] in
guard let customGetter = self.customGetter else {
@@ -246,7 +246,7 @@ public enum TransformableContainer<O: CoreStoreObject> {
}
}
internal private(set) lazy var setter: CoreStoreManagedObject.CustomSetter? = cs_lazy { [unowned self] in
internal private(set) lazy var setter: CoreStoreManagedObject.CustomSetter? = Internals.with { [unowned self] in
guard let customSetter = self.customSetter else {
@@ -357,15 +357,15 @@ public enum TransformableContainer<O: CoreStoreObject> {
get {
CoreStore.assert(
Internals.assert(
self.rawObject != nil,
"Attempted to access values from a \(cs_typeName(O.self)) meta object. Meta objects are only used for querying keyPaths and infering types."
"Attempted to access values from a \(Internals.typeName(O.self)) meta object. Meta objects are only used for querying keyPaths and infering types."
)
return withExtendedLifetime(self.rawObject!) { (object) in
CoreStore.assert(
Internals.assert(
object.isRunningInAllowedQueue() == true,
"Attempted to access \(cs_typeName(O.self))'s value outside it's designated queue."
"Attempted to access \(Internals.typeName(O.self))'s value outside it's designated queue."
)
if let customGetter = self.customGetter {
@@ -376,19 +376,19 @@ public enum TransformableContainer<O: CoreStoreObject> {
}
set {
CoreStore.assert(
Internals.assert(
self.rawObject != nil,
"Attempted to access values from a \(cs_typeName(O.self)) meta object. Meta objects are only used for querying keyPaths and infering types."
"Attempted to access values from a \(Internals.typeName(O.self)) meta object. Meta objects are only used for querying keyPaths and infering types."
)
return withExtendedLifetime(self.rawObject!) { (object) in
CoreStore.assert(
Internals.assert(
object.isRunningInAllowedQueue() == true,
"Attempted to access \(cs_typeName(O.self))'s value outside it's designated queue."
"Attempted to access \(Internals.typeName(O.self))'s value outside it's designated queue."
)
CoreStore.assert(
Internals.assert(
object.isEditableInContext() == true,
"Attempted to update a \(cs_typeName(O.self))'s value from outside a transaction."
"Attempted to update a \(Internals.typeName(O.self))'s value from outside a transaction."
)
if let customSetter = self.customSetter {
@@ -439,7 +439,7 @@ public enum TransformableContainer<O: CoreStoreObject> {
internal let affectedByKeyPaths: () -> Set<String>
internal var rawObject: CoreStoreManagedObject?
internal private(set) lazy var getter: CoreStoreManagedObject.CustomGetter? = cs_lazy { [unowned self] in
internal private(set) lazy var getter: CoreStoreManagedObject.CustomGetter? = Internals.with { [unowned self] in
guard let customGetter = self.customGetter else {
@@ -459,7 +459,7 @@ public enum TransformableContainer<O: CoreStoreObject> {
}
}
internal private(set) lazy var setter: CoreStoreManagedObject.CustomSetter? = cs_lazy { [unowned self] in
internal private(set) lazy var setter: CoreStoreManagedObject.CustomSetter? = Internals.with { [unowned self] in
guard let customSetter = self.customSetter else {