summaryrefslogtreecommitdiff
path: root/Juick/APIClient.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-12-02 23:23:31 +0300
committerGravatar Vitaly Takmazov2018-12-02 23:23:31 +0300
commita293a8e049fea49b8c2b8262fb92a29f73d66989 (patch)
tree2201a139fc19fcac59714e915f08b0aa7e816517 /Juick/APIClient.m
parent3bc3a38be7ccaf9622bdc86ffac37827af36f0f1 (diff)
Drop YYModel
Diffstat (limited to 'Juick/APIClient.m')
-rw-r--r--Juick/APIClient.m10
1 files changed, 5 insertions, 5 deletions
diff --git a/Juick/APIClient.m b/Juick/APIClient.m
index 6d9878d..6f69e9d 100644
--- a/Juick/APIClient.m
+++ b/Juick/APIClient.m
@@ -46,7 +46,7 @@
[manager GET:path parameters:params progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSMutableArray *messages = [NSMutableArray new];
[((NSArray *)responseObject) enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
- [messages addObject:[Message yy_modelWithJSON:obj]];
+ [messages addObject:[Message fromJSON:obj]];
}];
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
callback(messages, nil);
@@ -71,7 +71,7 @@
[formData appendPartWithFormData:[text dataUsingEncoding:NSUTF8StringEncoding] name:@"body"];
} progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSLog(@"Success!");
- Message *result = [Message yy_modelWithJSON:responseObject];
+ Message *result = [Message fromJSON:responseObject];
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
callback(result, nil);
}];
@@ -93,7 +93,7 @@
[formData appendPartWithFormData:[text dataUsingEncoding:NSUTF8StringEncoding] name:@"body"];
} progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSLog(@"Success!");
- Message *reply = [Message yy_modelWithJSON:responseObject];
+ Message *reply = [Message fromJSON:responseObject];
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
callback(reply, nil);
}];
@@ -131,7 +131,7 @@
NSMutableArray *groups = [NSMutableArray new];
NSArray *pms = [(NSDictionary *)responseObject objectForKey:@"pms"];
[pms enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
- [groups addObject:[Chat yy_modelWithJSON:obj]];
+ [groups addObject:[Chat fromJSON:obj]];
}];
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
callback(groups, nil);
@@ -152,7 +152,7 @@
NSMutableArray *messages = [NSMutableArray new];
NSArray *messagesList = (NSArray *)responseObject;
[messagesList enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
- [messages addObject:[Message yy_modelWithJSON:obj]];
+ [messages addObject:[Message fromJSON:obj]];
}];
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
callback(messages, nil);