If I understand the question, do you want something like the Locate button in Maps.app, where it shows the target icon and changes it to an activity indicator when it finds the device?
Unfortunately, UIBarButtonItems created using -initWithImage:style:target:action: or -initWithTitle:style:target:action: does not support arbitrary views inside the button.
You may have to draw the border of the button yourself. You can use the image for this and achieve the effect by stacking the UIActivityIndicatorView on top of the UIImageView containing the button border image.
source share