How to display a "spinning wheel" indicator in the centre of your screen

Screen Shot 2013-12-31 at 15.58.02Sometimes you want to tell the user that something’s happening behind the scenes and that there’s no need to panic. While your process is happening you can display a “spinning gear” in the middle of your screen.

One way of doing this is via a UIActivityIndicatorView.

You can create them in Interface Builder, but it’s very easy to create one and show it if and when necessary. Here’s how:

This creates it in the centre of your UI, but it’s invisible until switched on like so:

The UIActivityIndicatorView has a property that automatically hides it when stopped, so all we have to worry about is starting and stopping it when necessary.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.