Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIActivityIndicatorView Starting and Stopping

I have an activity indicator that needs to be activated as soon as a button is clicked and then stopped after a conditional statement...

I've looked at ways online to implement this but all i can find is setting them with webviews not simply turning them on and then off again.... below is my basic problem

-(IBAction)SavePassword:(id)sender{
\\start animating activity indicator
if(post recieved no errors){
\\stop animating activity indicator
}
\\else{
return the user error
}

if anyone can help it would be awesome :)

like image 553
MrPink Avatar asked Dec 06 '25 04:12

MrPink


1 Answers

it pretty straight forward... create an outlet and connect it in the interface builder..

@property(nonatomic, retain) IBOutlet UIActivityIndicatorView *activityIndicator;

in the implementation just use these two methods to start and stop the animation...

[self.activityIndicator startAnimating];

and

[self.activityIndicator stopAnimating];
like image 153
Swapnil Luktuke Avatar answered Dec 08 '25 16:12

Swapnil Luktuke