Today I spent a fair amount of time trying to write my own UIView that I could use to display a UIActivityIndicator and a message to a user when I am loading some things in the background. At first this didn’t seem all that hard and I had a working prototype in a matter of minutes using a standard nib and controller and I wired everything together. Then came the wrinkle — I need to show this new view over top of an existing view and have it paint on the main thread while I am downloading some content. Problem is that I tied up the main thread trying to do my download.
Once I finally figured out how to get my view to paint and then do the download I then found that I couldn’t make my view completely transparent — it was always black! Arrgh. So rather than spend anymore time trying to display a separate view I decided to change tactics and just add subviews onto my current view controller and I went searching around and found a GREAT project that is easy to use and saved me an afternoon of coding myself.
So if you are struggling to show a UIActivityIndicator in an elegant fashion then look to this site for some help: DS Activity View Project