update model for new version of Mantle

This commit is contained in:
Sami Samhuri 2015-04-24 20:33:58 -07:00
parent 78fee7d4b3
commit cbbbbe3a7e

View file

@ -27,6 +27,11 @@
+ (NSDictionary *)JSONKeyPathsByPropertyKey {
return @{
@"objectID" : @"id",
@"slug" : @"slug",
@"author" : @"author",
@"title" : @"title",
@"date" : @"date",
@"body" : @"body",
@"path" : @"url",
@"url" : @"link",
@"time" : @"", // ignore
@ -34,9 +39,9 @@
}
+ (NSValueTransformer *)urlJSONTransformer {
return [MTLValueTransformer reversibleTransformerWithForwardBlock:^NSURL *(NSString *str) {
return [MTLValueTransformer transformerUsingForwardBlock:^NSURL *(NSString *str, BOOL *success, NSError **error) {
return [NSURL URLWithString:str];
} reverseBlock:^NSString *(NSURL *url) {
} reverseBlock:^NSString *(NSURL *url, BOOL *success, NSError **error) {
return [url absoluteString];
}];
}