0.7.0
Breaking changes
This release introduces new, refined syntax for mapping. Unfortunately, it is not backwards compatible. To make new features work, we needed to change how mapping system works. And while we did that, it was a good time to improve syntax a little bit.
- Fields are gone! Every method, that contained field in its name, now reads property. Previously
[mapping mapFieldsFromArray:@[@"foo",@"bar"]];
[mapping mapFieldsFromDictionary:@{@"foo":@"bar"}];
Now:
[mapping mapPropertiesFromArray:@[@"foo",@"bar"]];
[mapping mapPropertiesFromDictionary:@{@"foo":@"bar"}];
- mapKey methods are more clear about what they do
[mapping mapKey:@"foo" toField:@"bar"];
is now
[mapping mapKeyPath:@"foo" toProperty:@"bar"];
- Relationship methods now use class directly instead of mapping object
[mapping hasOneMapping:[Phone objectMapping] forKey:@"foo"];
has become
[mapping hasOne:[Phone class] forKeyPath:@"foo"];
- Managed mapping blocks now receive NSManagedObjectContext they operate to allow state changes in the database if needed
Features
- Added support for recursive mappings, with any object graph you can imagine.
- Added convenience base classes, EKObjectModel and EKManagedObjectModel, that can serve as a base class for your models.
- Added EKMappingProtocol, that is used to define how mappings are provided. You can use it to implement mapping for classes, that don't inherit from EKObjectModel or EKManagedObjectModel.
- Added partial support for Swift - read more about it here
Bugfixes
- EKCoreDataImporter now caches inserted objects to prevent duplication