Created
April 19, 2012 18:19
-
-
Save kristopherjohnson/2422770 to your computer and use it in GitHub Desktop.
Display spinning activity indicator in a table-view cell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)showActivityIndicator:(BOOL)show forTableViewCell:(UITableViewCell *)cell | |
if (show) { | |
cell.accessoryType = UITableViewCellAccessoryNone; | |
UIActivityIndicatorView *activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; | |
[activityIndicatorView startAnimating]; | |
cell.accessoryView = activityIndicatorView; | |
[activityIndicatorView release]; | |
} | |
else { | |
cell.accessoryView = nil; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment