1 2 3 4 5 6 7 |
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; spinner.frame = CGRectMake(0, 0, 24, 24); UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; cell.accessoryView = spinner; [spinner startAnimating]; } |
This is the method for the UITableView, which runs the tap on the rows:
1 |
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath |
Within it, we create a ‘loading’:
1 2 |
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; spinner.frame = CGRectMake(0, 0, 24, 24); |
At the end we get the cell that we have tap and add like accessory of cell the UiActivityIndicatorView:
1 2 3 |
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; cell.accessoryView = spinner; [spinner startAnimating]; |
You have a youtube channel?
Not yet Jeanette :)
Insert an UIActivityIndicatorView in UITableView when click on row | Paul Production Pretty nice post. I just stumbled upon your blog and wished to say that I’ve really enjoyed browsing your blog posts. In any case I will be subscribing to your feed and I hope you write again soon!
Great post at Insert an UIActivityIndicatorView in UITableView when click on row | Paul Production. I was checking constantly this blog and I am impressed! Extremely helpful information particularly the last part :) I care for such info much. I was seeking this particular information for a long time. Thank you and good luck.
Excellent website. A lot of useful information here. I’m sending it to a few pals ans also sharing in delicious. And certainly, thank you to your sweat!
I found you’re blog via searching the net and I have to say. A Gigantic Thank you, I believed your post was very enlightening I’ll revisit to see what extra great information I can recieve here.