Releases: lucasmedeirosleite/EasyMapping
Releases · lucasmedeirosleite/EasyMapping
0.12.0
Features
- Added method
mapKeyPath:toProperty:withDateFormatter:
, that allows specifyingNSDateFormatter
to be used, when mapping strings toNSDate
and reverse. - Added
NSDateFormatter+EasyMappingAdditions
category, that allows gettingNSDateFormatter
for current thread. - Added mapping blocks for converting NSString to NSURL and backwards
Deprecations
mapKeyPath:toProperty:withDateFormat:
method is deprecated, please usemapKeyPath:toProperty:withDateFormatter:
instead.
0.11.0
Features
- Added support for incremental data for hasMany relationship(#81, thanks @baspellis)
0.10.0
Features
- Added helper XCTest classes to test mappings(#80, thanks @ilyapuchka)
0.9.0
Features
This version introduces support for non-nested one-mapping, that allows breaking a single JSON dictionary into graph of objects. For example:
{
"id":23,
"name": "Lucas",
"email": "[email protected]",
"gender" : "male",
"carId":3,
"carModel":"i30",
"carYear":"2013",
"phones": null
}
What we want from mapping this JSON to objects is a Person object, that contains Car object inside. And Car object should contain carId,carModel and carYear properties. This release adds a new method to do that:
[mapping hasOne:[Car class] forDictionaryFromKeyPaths:@[@"carId",@"carModel",@"carYear"]
forProperty:@"car" withObjectMapping:[Car objectMapping]];
This also works for serialization, object can be serialized into NSDictionary that we had earlier.
0.8.1
Bugfixes
- Fixed issue, where primary key from representation would not be picked up by CoreDataImporter, if primary key uses mapping block(@baspellis)
0.8.0
Features
- Added new mapping methods to allow create mappings separate from model class(@toolboxash)
- Added EKSerializer methods to allow serializing CoreData objects with reverse mapping blocks.
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