File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -245,8 +245,11 @@ - (void) sendRequest:(__weak NSDictionary * _Nullable )options
245245 [task resume ];
246246
247247 // network status indicator
248- if ([[options objectForKey: CONFIG_INDICATOR] boolValue ] == YES )
249- [[UIApplication sharedApplication ] setNetworkActivityIndicatorVisible: YES ];
248+ if ([[options objectForKey: CONFIG_INDICATOR] boolValue ] == YES ) {
249+ dispatch_async (dispatch_get_main_queue (), ^{
250+ [[UIApplication sharedApplication ] setNetworkActivityIndicatorVisible: YES ];
251+ });
252+ }
250253 __block UIApplication * app = [UIApplication sharedApplication ];
251254
252255}
@@ -483,7 +486,9 @@ - (void) URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCom
483486 NSString * respStr = [NSNull null ];
484487 NSString * rnfbRespType = @" " ;
485488
486- [[UIApplication sharedApplication ] setNetworkActivityIndicatorVisible: NO ];
489+ dispatch_async (dispatch_get_main_queue (), ^{
490+ [[UIApplication sharedApplication ] setNetworkActivityIndicatorVisible: NO ];
491+ });
487492
488493 if (respInfo == nil )
489494 {
You can’t perform that action at this time.
0 commit comments