UIActivityIndicatorView: isAnimating property
The isAnimating property indicates whether the activity indicator is spinning.
Value
A boolean.
| Value | Meaning |
|---|---|
true | Spinning. startAnimating() was called, and stopAnimating() hasn't been called since |
false | Not spinning |
- Read-only; assigning to it throws
TypeError, and the value stays unchanged. - It's
falseon a new indicator. - It changes only through
startAnimating()andstopAnimating(). There's no change event: what changes it is the app's own code. - Writing
trueto the inheritedisHiddendoesn't affect it: the indicator is hidden, andisAnimatingstaystrue.
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).