Reputation: 679
I've got a method that is in my app delegate that is called to pull information from a web server. Is there a way to easily incorporate UIActivityViewIndicators into the app delegate? Everything I've found so far online shows the Indicator requiring to be added as a subview. Is this doable? If so, can you point me in the right direction on where to find this?
[edit] I'm using a storyboard instead of xibs.
Upvotes: 2
Views: 3680
Reputation: 4391
Yes, you can add the UIActivityIndicatorView directly from your AppDelegate. There should be an object or property of your UIViewController inside your AppDelegate. There, you can add it.
[viewController.view addSubView:activityIndicatorView];
Upvotes: 0
Reputation: 10828
You can easily add a UIActivityViewIndicators
with few lines of code:
UIActivityIndicatorView *aiv = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite] autorelease];
aiv.center = self.window.rootViewController.view.center;
[self.window.rootViewController.view addSubview:aiv];
[aiv startAnimating];
But there are a lot of open source project like MBProgressHUD that gives you more stylish indicator, with other additions..
Upvotes: 12