File tree 1 file changed +8
-3
lines changed
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
245
245
[task resume ];
246
246
247
247
// 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
+ }
250
253
__block UIApplication * app = [UIApplication sharedApplication ];
251
254
252
255
}
@@ -483,7 +486,9 @@ - (void) URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCom
483
486
NSString * respStr = [NSNull null ];
484
487
NSString * rnfbRespType = @" " ;
485
488
486
- [[UIApplication sharedApplication ] setNetworkActivityIndicatorVisible: NO ];
489
+ dispatch_async (dispatch_get_main_queue (), ^{
490
+ [[UIApplication sharedApplication ] setNetworkActivityIndicatorVisible: NO ];
491
+ });
487
492
488
493
if (respInfo == nil )
489
494
{
You can’t perform that action at this time.
0 commit comments