Sometimes you need to quickly throw a progress indicator over your view while something processes (hopefully in the background).
I've found this code to be useful for that situation. Apply to your needs.
UIActivityIndicatorView *activityIndicatorView = [[UIActivityIndicatorView alloc] initWithFrame:self.view.frame];
activityIndicatorView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
activityIndicatorView.backgroundColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.5];
[self.view addSubview:activityIndicatorView];
[activityIndicatorView startAnimating];
[self.presentingViewController dismissViewControllerAnimated:YES completion:^{
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul);
dispatch_async(queue, ^{
// do your processing in the background here
dispatch_sync(dispatch_get_main_queue(), ^{
// Update UI
[activityIndicatorView stopAnimating];
[activityIndicatorView removeFromSuperview];
});
});
}];
Super mechs android app is a new free to play game that lets players take control of giant robots in an all-out battle to save the world. The game features over 20 different mechs to choose from, as well as an array of weapons and abilities to help you fight your way through the enemy lines. Super mechs is currently available on Android and iOS devices.
ReplyDeleteThis very informative and interesting blog.
ReplyDeleteAvienTech takes pride in its unwavering commitment to client satisfaction. The company understands that every client is unique, and their requirements are distinct.