The way I do it :
Create a LoadingViewController Class with a UILabel, a UIActivityIndicator and black background .
In the ViewDidLoad method, i set :
[self.view setAlpha:0.0];
[self.activityIndicator startAnimating];
I implement two methods :
-(void)appear{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[self.view setAlpha:0.65];
[UIView commitAnimations];
}
-(void)disappear{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[self.view setAlpha:0.0];
[UIView commitAnimations];
}
In the label you can set a custom text.
Import this class in the class you are working on and just call :
[loadingViewController appear];
and
[loadingViewController disappear];
I don't have a Mac with me right now and can't verify if i just wrote any mistakes but I hope you get the idea :)
I always prefer to make a custom class for this in case I'll need it at many places in my app.