Add UIActivityIndicatorView as a sub-button of the button:
// Create spinner UIActivityIndicatorView *myIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; // Position the spinner [myIndicator setCenter:CGPointMake(myButton.frame.size.width / 2, myButton.frame.size.height / 2)]; // Add to button [myButton addSubview:myIndicator]; // Start the animation [myIndicator startAnimating];
pheelicks
source share