Use an activity indicator to show that a task is in progress. An activity indicator appears as a “gear” that is either spinning or stopped.


You control when an activity indicator animates by calling the startAnimating() and stopAnimating() methods. To automatically hide the activity indicator when animation stops, set the hidesWhenStopped property to true.

Starting in iOS 5.0, you can set the color of the activity indicator by using the color property.

For more information about appearance and behavior configuration, see Activity Indicators.


Initializing an Activity Indicator

init(activityIndicatorStyle: UIActivityIndicatorViewStyle)

Initializes and returns an activity-indicator object.

Managing an Activity Indicator

func startAnimating()

Starts the animation of the progress indicator.

func stopAnimating()

Stops the animation of the progress indicator.

var hidesWhenStopped: Bool

A Boolean value that controls whether the receiver is hidden when the animation is stopped.

Configuring the Activity Indicator Appearance

var activityIndicatorViewStyle: UIActivityIndicatorViewStyle

The basic appearance of the activity indicator.

var color: UIColor?

The color of the activity indicator.



The visual style of the progress indicator.

Instance Properties