如果网络不可用,那么它显示“网络不可用”的警告但在此之后加载微调器无法解除...它不断显示加载微调器......
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
[self showSpinner];
[self getDashBoard];
}
- (void) getDashBoard {
//[API call]
// if success then
//assign values from response
[self dismissSpinner]
// else
// [self dismissSpinner]
// [Utility displayAlert:@"Error" WithMessage:@"Network not available"];
}
#pragma mark - LodingSpinner
- (void) showSpinner {
if (([[[UIDevice currentDevice] systemVersion] compare:@"8.0" options:NSNumericSearch] == NSOrderedAscending)) {
// use UIAlertView
}
else {
lodingSpinner = [Utility showProgress];
[self.parentViewController presentViewController:lodingSpinner animated:NO completion:nil];
}
}
- (void) dismissSpinner {
if (([[[UIDevice currentDevice] systemVersion] compare:@"8.0" options:NSNumericSearch] == NSOrderedAscending)) {
// use UIAlertView
}
else {
[lodingSpinner dismissViewControllerAnimated:YES completion:nil];
}
}