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!

7 thoughts on “UIBarButtonItem with Activity Indicator, Done The Proper Way

  1. Hello Vandad and thanks for this great blog (really a lot of great stuff here), one question : why application will be rejected? and which solution you advice? Thanks.

    • @Tarek

      Hi. I realize that your app will be rejected if you just search for that string that I mentioned in the video. I would basically search for each character individually in the string. If you search for one character at a time, then you shouldn’t have a problem at all.

  2. Thanks Vandad for the reply,

    I got recently got a copy of your book and it’s a really a great book, with a lot of great code. For the next edition i think it will bea great if you add more examples on networking (sockets,..), SQLite and Webservices. Thanks again.

  3. hi, it’s really cool for that solution. But I still don’t understand the part of reject by Apple. How that happen? Which “String” you mean?
    Thx ^^

Leave a comment