Skip to content

0.20.0

Compare
Choose a tag to compare
@DenTelezhkin DenTelezhkin released this 06 Oct 14:15
· 86 commits to master since this release

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 return EKRelationshipMapping 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 and hasManyMappings are now arrays instead of being dictionaries.
  • EKRelationshipMapping now has mappingResolver and serializationResolver properties instead of objectClass property of EKMappingProtocol type
  • NSDateFormatter extension with ek_dateFormatterForCurrentThread is removed.