diff options
author | Justin R. Miller <incanus@codesorcery.net> | 2014-03-27 15:23:05 -0700 |
---|---|---|
committer | Justin R. Miller <incanus@codesorcery.net> | 2014-03-27 15:23:05 -0700 |
commit | 28471f1a424d16604d6d98ed4a2e0d18cc418050 (patch) | |
tree | 6f756eea2898268c56579ad5e0d7af090ee967d0 /ios | |
parent | 9086357bd6ae79c4be7f871b18e8a232fea907c6 (diff) | |
download | qtlocation-mapboxgl-28471f1a424d16604d6d98ed4a2e0d18cc418050.tar.gz |
bring back the iOS net activity spinner
Diffstat (limited to 'ios')
-rw-r--r-- | ios/MBXViewController.mm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ios/MBXViewController.mm b/ios/MBXViewController.mm index f723d49edc..9f50ab4793 100644 --- a/ios/MBXViewController.mm +++ b/ios/MBXViewController.mm @@ -449,6 +449,8 @@ namespace llmr { NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:@(url.c_str())] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { + [[NSNotificationCenter defaultCenter] postNotificationName:MBXUpdateActivityNotification object:nil]; + Response res; if ( ! error && [response isKindOfClass:[NSHTTPURLResponse class]]) @@ -467,6 +469,8 @@ namespace llmr [task resume]; + [[NSNotificationCenter defaultCenter] postNotificationName:MBXUpdateActivityNotification object:nil]; + Request *req = new Request(); req->identifier = task.taskIdentifier; @@ -480,8 +484,16 @@ namespace llmr [[NSURLSession sharedSession] getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) { for (NSURLSessionDownloadTask *task in downloadTasks) + { if (task.taskIdentifier == request->identifier) - return [task cancel]; + { + [task cancel]; + + [[NSNotificationCenter defaultCenter] postNotificationName:MBXUpdateActivityNotification object:nil]; + + return; + } + } }]; } |