<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIActivityIndicatorView",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIActivityIndicatorView"
  },
  "title" : "UIActivityIndicatorView"
}
-->

# UIActivityIndicatorView

A view that shows that a task is in progress.

```
@MainActor class UIActivityIndicatorView
```

## Overview

You control when an activity indicator animates by calling the [`startAnimating()`](/documentation/UIKit/UIActivityIndicatorView/startAnimating()) and [`stopAnimating()`](/documentation/UIKit/UIActivityIndicatorView/stopAnimating()) methods. To automatically hide the activity indicator when animation stops, set the [`hidesWhenStopped`](/documentation/UIKit/UIActivityIndicatorView/hidesWhenStopped) property to <doc://com.apple.documentation/documentation/Swift/true>.

You can set the color of the activity indicator by using the [`color`](/documentation/UIKit/UIActivityIndicatorView/color) property.

## Topics

### Creating an activity indicator

[`init(style:)`](/documentation/UIKit/UIActivityIndicatorView/init(style:))

Creates an activity indicator.

[`init(frame:)`](/documentation/UIKit/UIActivityIndicatorView/init(frame:))

Creates an activity indicator with the specified frame rectangle.

[`init(coder:)`](/documentation/UIKit/UIActivityIndicatorView/init(coder:))

Creates an activity indicator from data in an unarchiver.

### Managing an activity indicator

[`startAnimating()`](/documentation/UIKit/UIActivityIndicatorView/startAnimating())

Starts the animation of the progress indicator.

[`stopAnimating()`](/documentation/UIKit/UIActivityIndicatorView/stopAnimating())

Stops the animation of the progress indicator.

[`isAnimating`](/documentation/UIKit/UIActivityIndicatorView/isAnimating)

A Boolean value indicating whether the activity indicator is currently running its animation.

[`hidesWhenStopped`](/documentation/UIKit/UIActivityIndicatorView/hidesWhenStopped)

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

### Configuring the activity indicator appearance

[`style`](/documentation/UIKit/UIActivityIndicatorView/style-swift.property)

The basic appearance of the activity indicator.

[`color`](/documentation/UIKit/UIActivityIndicatorView/color)

The color of the activity indicator.

### Constants

[`UIActivityIndicatorView.Style`](/documentation/UIKit/UIActivityIndicatorView/Style-swift.enum)

The visual style of the progress indicator.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)