Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show loading animation in a view - IOS

I have a view in which I want to show loading animation. I have seen some application they are showing circular image to show loading, and the action will happen on background, Same thing I want to achieve here, Any inbuilt animation is available in IOS?

TIA

like image 878
Feroz Avatar asked Dec 20 '22 17:12

Feroz


2 Answers

You can use the built in activity indicator.

UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
indicator.center = CGPointMake(alert.bounds.size.width / 2 , (alert.bounds.size.height) /2);
[indicator startAnimating];

simply add it as a subview in to your view.

like image 97
Roma-MT Avatar answered Jan 04 '23 21:01

Roma-MT


You may use the UIActivityIndicator if you want to keep things simple. Or there are plenty of open source activity indicators that do a lot of fancy stuff in addition to just showing a spinning wheel. MBProgressHUD and SVProgressHUD are two neat implementations.

like image 37
Bourne Avatar answered Jan 04 '23 23:01

Bourne