Create (or get a link to) the button, as usual, then, referring to the button, create your own counter and set it as a sub-item of the button. It might also be worth turning off the button to stop a few clicks.
Something in the following lines should do the trick:
... UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; button.frame = CGRectMake(10, 10, 70, 40); [button setTitle:@"Next" forState:UIControlStateNormal]; [button addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:button]; ... - (void)click:(UIButton *)button { [button setTitle:@"" forState:UIControlStateNormal]; UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; [spinner startAnimating]; spinner.frame = button.bounds; [button addSubview:spinner]; button.enabled = NO;
source share