0.20.0
This release requires iOS 8 / macOS 10.9 / tvOS 9.0 / watchOS 2.0 and higher.
New
- API was annotated with lightweight Objective-c generics and nullability annotations to be better imported in Swift.
- All relationship mappings, like
hasOne:forKeyPath:
, now returnEKRelationshipMapping
instead of void, and allow mapping customization via condition property. - It's now possible to switch mappings based on passed representation, like so:
EKRelationshipMapping * relationship = [mapping hasMany:Dog.class forKeyPath:@"animals" forProperty:@"pets"];
relationship.mappingResolver = ^EKObjectMapping *(id representation){
if ([representation[@"type"] isEqualToString:@"dog"]) {
return [Dog objectMapping];
} else {
return [Wolf objectMapping];
}
};
Breaking API changes
EKObjectMapping
hasOneMappings
andhasManyMappings
are now arrays instead of being dictionaries.EKRelationshipMapping
now hasmappingResolver
andserializationResolver
properties instead ofobjectClass
property ofEKMappingProtocol
typeNSDateFormatter
extension withek_dateFormatterForCurrentThread
is removed.