Skip to content

Instantly share code, notes, and snippets.

@waltflanagan
Last active August 29, 2015 14:26
Show Gist options
  • Save waltflanagan/b385782bd8ff2b4295ce to your computer and use it in GitHub Desktop.
Save waltflanagan/b385782bd8ff2b4295ce to your computer and use it in GitHub Desktop.
func ingest<T:Ingestable, U where U:Persistable, U:SwiftyMeragable, U:NSManagedObject>(ingestables: [T]?, completion: ( persistedObjects:[U] )->Void) {
}
func ingest<T where T:Ingestable, T.IngestedType:Persistable, T.IngestedType:SwiftyMeragable, T.IngestedType:NSManagedObject>(ingestables: [T]?, completion: (( persistedObjects:[NSManagedObjectID] )->Void)? = nil) {
}
internal protocol Ingestable : SwiftySerializable {
typealias IngestedType
func fetchRequestForUniquing() -> NSFetchRequest?
}
extension TransientUser : Ingestable {
typealias IngestedType = PersistentUser
func fetchRequestForUniquing() -> NSFetchRequest? {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment