I have used SVProgressHUD for progresshud. I found that SVProgressHUD doesnt dismiss when user moves from one screen to another. Its tedious to call [SVProgressHUD dismiss];
in -(void)viewWillDisappear:(BOOL)animated
of every class so i want to find the better solutions. Currently i have implemented below code But I want to find some better methods
-(void)viewWillDisappear:(BOOL)animated{
[SVProgressHUD dismiss];
}
I know To dismiss the HUD we need to call one of the following method:
+ (void)dismiss;
+ (void)dismissWithSuccess:(NSString*)successString;
+ (void)dismissWithSuccess:(NSString*)successString afterDelay:(NSTimeInterval)seconds;
+ (void)dismissWithError:(NSString*)errorString;
+ (void)dismissWithError:(NSString*)errorString afterDelay:(NSTimeInterval)seconds;
But I dont want to call [SVProgressHUD dismiss];
in -(void)viewWillDisappear:(BOOL)animated
of every class since writing same code in overall projects in each class is not good way of coding
You can create a super class where every class that uses the SVProgressHUD inherit that class and in the super class you can do like this :