Swift 4.1 support

This commit is contained in:
John Rommel Estropia
2018-03-10 21:07:53 +09:00
parent 83e6082c56
commit 5431e2e974
19 changed files with 46 additions and 40 deletions

View File

@@ -91,13 +91,13 @@ extension NSManagedObjectContext: FetchableSource, QueryableSource {
@nonobjc
public func fetchExisting<D: DynamicObject, S: Sequence>(_ objects: S) -> [D] where S.Iterator.Element == D {
return objects.flatMap({ self.fetchExisting($0.cs_id()) })
return objects.compactMap({ self.fetchExisting($0.cs_id()) })
}
@nonobjc
public func fetchExisting<D: DynamicObject, S: Sequence>(_ objectIDs: S) -> [D] where S.Iterator.Element == NSManagedObjectID {
return objectIDs.flatMap({ self.fetchExisting($0) })
return objectIDs.compactMap({ self.fetchExisting($0) })
}
@nonobjc