Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kristopherjohnson/2422770 to your computer and use it in GitHub Desktop.
Save kristopherjohnson/2422770 to your computer and use it in GitHub Desktop.
Display spinning activity indicator in a table-view cell
- (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