mirror of
https://github.com/samsonjs/samhuri.net-ios.git
synced 2026-04-27 15:07:44 +00:00
update model for new version of Mantle
This commit is contained in:
parent
78fee7d4b3
commit
cbbbbe3a7e
1 changed files with 7 additions and 2 deletions
|
|
@ -27,6 +27,11 @@
|
||||||
+ (NSDictionary *)JSONKeyPathsByPropertyKey {
|
+ (NSDictionary *)JSONKeyPathsByPropertyKey {
|
||||||
return @{
|
return @{
|
||||||
@"objectID" : @"id",
|
@"objectID" : @"id",
|
||||||
|
@"slug" : @"slug",
|
||||||
|
@"author" : @"author",
|
||||||
|
@"title" : @"title",
|
||||||
|
@"date" : @"date",
|
||||||
|
@"body" : @"body",
|
||||||
@"path" : @"url",
|
@"path" : @"url",
|
||||||
@"url" : @"link",
|
@"url" : @"link",
|
||||||
@"time" : @"", // ignore
|
@"time" : @"", // ignore
|
||||||
|
|
@ -34,9 +39,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSValueTransformer *)urlJSONTransformer {
|
+ (NSValueTransformer *)urlJSONTransformer {
|
||||||
return [MTLValueTransformer reversibleTransformerWithForwardBlock:^NSURL *(NSString *str) {
|
return [MTLValueTransformer transformerUsingForwardBlock:^NSURL *(NSString *str, BOOL *success, NSError **error) {
|
||||||
return [NSURL URLWithString:str];
|
return [NSURL URLWithString:str];
|
||||||
} reverseBlock:^NSString *(NSURL *url) {
|
} reverseBlock:^NSString *(NSURL *url, BOOL *success, NSError **error) {
|
||||||
return [url absoluteString];
|
return [url absoluteString];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue