I have a second view in my app that takes about 2-3 seconds to load. How can I create an activity indicator while the view loads?
I know I can do something like this:
UIActivityIndicatorView *activityView=[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
activityView.center=self.view.center;
[activityView startAnimating];
[self.view addSubview:activityView];
But how do I tell my app to only load the activity view while switching to another view?