Rounded Box around Activity Indicator with "Loading" Text

ios, objective-c, uiactivityindicatorview, uiviewcontroller

Solution

If you want to use some custom component, you can use MBProgressHUD. Here is the source code for that.

If you want to make it yourself, you can check their source code to see how they have implemented this and you can follow a similar approach for your code. Basically that will involve subclassing `UIView` and drawing the activity indicator and label in `drawRect` method.

Problem

I know how to make an activity indicator with a simple square background, but there is no padding at all, and I don't know how to get the word "loading" to display like this. Does anyone know how this is accomplished? I've looked online and can't seem to find anything. Thank you all!

Original source