move type safety goodness

This commit is contained in:
John Estropia
2017-02-21 19:17:06 +09:00
parent 9ff1c9d545
commit 3224fcf71d
9 changed files with 732 additions and 608 deletions

View File

@@ -59,7 +59,7 @@ public protocol ImportableUniqueObject: ImportableObject {
/**
The data type for the entity's unique ID attribute
*/
associatedtype UniqueIDType: CoreStoreUniqueIDAttributeType
associatedtype UniqueIDType: CoreStoreImportableAttributeType
/**
The keyPath to the entity's unique ID attribute
@@ -192,14 +192,14 @@ public extension ImportableUniqueObject where Self: NSManagedObject {
get {
return UniqueIDType.cs_fromUniqueIDNativeType(
self.value(forKey: type(of: self).uniqueIDKeyPath) as! UniqueIDType.NativeTypeForUniqueID
return UniqueIDType.cs_fromImportableNativeType(
self.value(forKey: type(of: self).uniqueIDKeyPath) as! UniqueIDType.ImportableNativeType
)!
}
set {
self.setValue(
newValue.cs_toUniqueIDNativeType(),
newValue.cs_toQueryableNativeType(),
forKey: type(of: self).uniqueIDKeyPath
)
}