Merge branch 'develop' into prototype/Swift_3_2

# Conflicts:
#	Sources/CoreStoreManagedObject.swift
#	Sources/CoreStoreSchema.swift
#	Sources/NSEntityDescription+DynamicModel.swift
#	Sources/Value.swift
This commit is contained in:
John Rommel Estropia
2017-06-11 09:16:34 +09:00
10 changed files with 678 additions and 294 deletions

View File

@@ -75,14 +75,15 @@ internal extension NSEntityDescription {
}
}
@nonobjc
internal var keyPathsByAffectedKeyPaths: [RawKeyPath: Set<RawKeyPath>] {
get {
if let userInfo = self.userInfo,
let function = userInfo[UserInfoKey.CoreStoreManagedObjectKeyPathsByAffectedKeyPaths] as! [RawKeyPath: Set<RawKeyPath>]? {
let value = userInfo[UserInfoKey.CoreStoreManagedObjectKeyPathsByAffectedKeyPaths] {
return function
return value as! [RawKeyPath: Set<RawKeyPath>]
}
return [:]
}
@@ -95,6 +96,27 @@ internal extension NSEntityDescription {
}
}
@nonobjc
internal var customGetterSetterByKeyPaths: [RawKeyPath: CoreStoreManagedObject.CustomGetterSetter] {
get {
if let userInfo = self.userInfo,
let value = userInfo[UserInfoKey.CoreStoreManagedObjectCustomGetterSetterByKeyPaths] {
return value as! [RawKeyPath: CoreStoreManagedObject.CustomGetterSetter]
}
return [:]
}
set {
cs_setUserInfo { (userInfo) in
userInfo[UserInfoKey.CoreStoreManagedObjectCustomGetterSetterByKeyPaths] = newValue
}
}
}
// MARK: Private
@@ -108,6 +130,8 @@ internal extension NSEntityDescription {
fileprivate static let CoreStoreManagedObjectVersionHashModifier = "CoreStoreManagedObjectVersionHashModifier"
fileprivate static let CoreStoreManagedObjectKeyPathsByAffectedKeyPaths = "CoreStoreManagedObjectKeyPathsByAffectedKeyPaths"
fileprivate static let CoreStoreManagedObjectCustomGetterSetterByKeyPaths = "CoreStoreManagedObjectCustomGetterSetterByKeyPaths"
}
private func cs_setUserInfo(_ closure: (_ userInfo: inout [AnyHashable: Any]) -> Void) {