mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-14 14:21:38 +01:00
extra extra type safety for attributes (fetching and importing)
This commit is contained in:
@@ -59,7 +59,7 @@ public protocol ImportableUniqueObject: ImportableObject {
|
||||
/**
|
||||
The data type for the entity's unique ID attribute
|
||||
*/
|
||||
associatedtype UniqueIDType: CoreStoreSupportedAttributeType
|
||||
associatedtype UniqueIDType: CoreStoreUniqueIDAttributeType
|
||||
|
||||
/**
|
||||
The keyPath to the entity's unique ID attribute
|
||||
@@ -192,14 +192,14 @@ public extension ImportableUniqueObject where Self: NSManagedObject {
|
||||
|
||||
get {
|
||||
|
||||
return UniqueIDType.cs_fromNativeType(
|
||||
self.value(forKey: type(of: self).uniqueIDKeyPath) as! UniqueIDType.CoreStoreNativeType
|
||||
return UniqueIDType.cs_fromUniqueIDNativeType(
|
||||
self.value(forKey: type(of: self).uniqueIDKeyPath) as! UniqueIDType.NativeTypeForUniqueID
|
||||
)!
|
||||
}
|
||||
set {
|
||||
|
||||
self.setValue(
|
||||
newValue.cs_toNativeType(),
|
||||
newValue.cs_toUniqueIDNativeType(),
|
||||
forKey: type(of: self).uniqueIDKeyPath
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user