Skip to content

UIActivityIndicatorView: isAnimating property ​

The isAnimating property indicates whether the activity indicator is spinning.

Value ​

A boolean.

ValueMeaning
trueSpinning. startAnimating() was called, and stopAnimating() hasn't been called since
falseNot spinning
  • Read-only; assigning to it throws TypeError, and the value stays unchanged.
  • It's false on a new indicator.
  • It changes only through startAnimating() and stopAnimating(). There's no change event: what changes it is the app's own code.
  • Writing true to the inherited isHidden doesn't affect it: the indicator is hidden, and isAnimating stays true.

Examples ​

js
const spinner = new UIActivityIndicatorView();
console.log(spinner.isAnimating);
spinner.startAnimating();
console.log(spinner.isAnimating);
spinner.stopAnimating();
console.log(spinner.isAnimating);

Result: Prints false, true, false in order.

Corresponding iOS API ​

UIActivityIndicatorView.isAnimating (the ObjC getter is isAnimating).

See also ​