Created
October 13, 2019 13:32
-
-
Save userow/54735a3bd7fd29152b2a7333879e904f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)loginComplete { | |
dispatch_group_t group = dispatch_group_create(); | |
dispatch_group_enter(group); | |
dispatch_group_enter(group); | |
[self.languageRouter receiveWithSuccess:^(NSDictionary *object) { | |
[self createOrUpdateLanguagesWithJSON:object completion:^{ | |
dispatch_group_leave(group); | |
}]; | |
} failure:^(NSString *message, NSInteger code, ErrorType type) { | |
self.successfullDownload = NO; | |
[self.hud hideAnimated:YES]; | |
[self showAlertWithTitle:@"" message:message]; | |
dispatch_group_leave(group); | |
}]; | |
[self.languageRouter receiveCountriesWithSuccess:^(NSDictionary *object) { | |
[self createOrUpdateCouintriesWithJSON:object completion:^{ | |
dispatch_group_leave(group); | |
}]; | |
} failure:^(NSString *message, NSInteger code, ErrorType type) { | |
self.successfullDownload = NO; | |
[self.hud hideAnimated:YES]; | |
[self showAlertWithTitle:@"" message:message]; | |
dispatch_group_leave(group); | |
}]; | |
dispatch_group_notify(group, dispatch_get_main_queue(), ^{ | |
if (self.successfullDownload) { | |
[self languageCountryDownloadCompleted]; | |
} else { | |
[Profile clear]; | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment