rewrote ImportableObject protocol methods

This commit is contained in:
John Rommel Estropia
2015-08-23 14:15:48 +09:00
parent 093c1d410f
commit 006d5e1402
2 changed files with 65 additions and 24 deletions

View File

@@ -129,13 +129,13 @@ public final class ObjectMonitor<T: NSManagedObject> {
let previousCommitedAttributes = strongSelf.lastCommittedAttributes
let currentCommitedAttributes = object.committedValuesForKeys(nil) as! [String: NSObject]
let changedKeys = currentCommitedAttributes.keys.reduce(Set<String>()) { (var changedKeys, key) -> Set<String> in
var changedKeys = Set<String>()
for key in currentCommitedAttributes.keys {
if previousCommitedAttributes[key] != currentCommitedAttributes[key] {
changedKeys.insert(key)
}
return changedKeys
}
strongSelf.lastCommittedAttributes = currentCommitedAttributes