TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jan 2015 |
Maintained by kaiinui.
[iOS] Dictionary Serializable Object Protocol
@interface Book : NSObject <AQSDictionarySerialization>
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *authorName;
@property (nonatomic, copy) NSNumber *isPublished;
@end
@implementaion Book
+ (NSDictionary *)aqs_keyPathsByPropertyKey {
return @{
@"title": @"title",
@"authorName": @"author_name",
@"isPublished": @"is_published"
};
}
@end
Then
[[AQSDictionarySerializer serializer] applyPatchForObject:book withDictionary:@{
@"title": @"Harry Potter",
@"author_name": @"J. K. Rowling",
@"is_published": @(NO)
}];
BOOL
, NSInteger
, etc...keyPath
such as author.name
.