objective c - iOS: SVProgressHUD doesnt dismiss when user moves from one screen to another in IOS Xcode -
i have used svprogresshud progresshud. found svprogresshud doesnt dismiss when user moves 1 screen another. tedious call [svprogresshud dismiss];
in -(void)viewwilldisappear:(bool)animated
of every class want find better solutions. have implemented below code want find better methods
-(void)viewwilldisappear:(bool)animated{ [svprogresshud dismiss]; }
i know dismiss hud need call 1 of 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 dont want call [svprogresshud dismiss];
in -(void)viewwilldisappear:(bool)animated
of every class since writing same code in overall projects in each class not way of coding
you can create super class every class uses svprogresshud inherit class , in super class can :
-(void)viewwilldisappear:(bool)animated{ if([svprogresshud isvisible]) [svprogresshud dismiss];}
Comments
Post a Comment