Skip to content

Instantly share code, notes, and snippets.

@sergdort
Last active December 16, 2015 13:24
Show Gist options
  • Save sergdort/3842c428663d70cb7161 to your computer and use it in GitHub Desktop.
Save sergdort/3842c428663d70cb7161 to your computer and use it in GitHub Desktop.
public protocol JSONToEntityMapable {
static var map:[String:String] {get} //[entityKey : jsonKey]
static var relatedByAttribute:String {get} // entityKey which defines the uniqueness of object
static var relatedJsonKey:String {get} // jsonKey which defines the uniqueness of object
}
extension JSONToEntityMapable {
static var map:[String:String] {
return [:]
}
static var relatedByAttribute:String {
return ""
}
static var relatedJsonKey:String {
return ""
}
}
extension NSManagedObject:JSONToEntityMapable {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment