I am trying to aggregate the data from multiple NSURLSessionDataTasks that will run concurrently.
__block NSMutableDictionary *languageDetails = [NSMutableDictionary new];
[repos enumerateObjectsUsingBlock:^(NSDictionary *repoDict, NSUInteger idx, BOOL * _Nonnull stop) {
NSString *languageUrl = repoDict[@"languages_url"];
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:languageUrl]
completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
// JSON Parse response
// Update languageDetails
}];
[task resume];
}];
How do I set this up with a master callback or delegate that gets called once all the data tasks are done?