UIBarButtonItem with Activity Indicator, Done The Proper Way

Source Code for This Post

You want to add a UIActivityIndicator in iOS SDK on top of a navigation bar button and you have searched everywhere for a solution. Wherever you went, they said “initialize your UIBarButtonItem with a custom view”. But you know what? That doesn’t quite do the trick.

What you want is this:

UIActivityIndicator on a UIBarButtonItem

And they keep showing you a solution that does this:

UIBarButtonItem initialized with a custom view of type UIActivityIndicator

To explain how you should do it the right way (first image), have a look at my screencast here. Make sure to leave a comment!