iOS Developer Library — Pre-Release

Developer

UIKit Framework Reference UIActivityIndicatorView Class Reference

Options
Deployment Target:

On This Page
Language:

UIActivityIndicatorView

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. More...

Inheritance


Import Statement


Swift

import UIKit

Objective-C

@import UIKit;

Availability


Available in iOS 2.0 and later.
  • Starts the animation of the progress indicator.

    Declaration

    Swift

    func startAnimating()

    Objective-C

    - (void)startAnimating

    Discussion

    When the progress indicator is animated, the gear spins to indicate indeterminate progress. The indicator is animated until stopAnimating is called.

    Import Statement

    Swift

    import UIKit

    Availability

    Available in iOS 2.0 and later.

  • Stops the animation of the progress indicator.

    Declaration

    Swift

    func stopAnimating()

    Objective-C

    - (void)stopAnimating

    Discussion

    Call this method to stop the animation of the progress indicator started with a call to startAnimating. When animating is stopped, the indicator is hidden, unless hidesWhenStopped is NOfalse.

    Import Statement

    Swift

    import UIKit

    Availability

    Available in iOS 2.0 and later.

  • Returns whether the receiver is animating.

    Declaration

    Swift

    func isAnimating() -> Bool

    Objective-C

    - (BOOL)isAnimating

    Return Value

    YEStrue if the receiver is animating, otherwise NOfalse.

    Import Statement

    Swift

    import UIKit

    Availability

    Available in iOS 2.0 and later.

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

    Declaration

    Swift

    var hidesWhenStopped: Bool

    Objective-C

    @property(nonatomic) BOOL hidesWhenStopped

    Discussion

    If the value of this property is YEStrue (the default), the receiver sets its hidden property (UIView) to YEStrue when receiver is not animating. If the hidesWhenStopped property is NOfalse, the receiver is not hidden when animation stops. You stop an animating progress indicator with the stopAnimating method.

    Import Statement

    Swift

    import UIKit

    Availability

    Available in iOS 2.0 and later.

Data Types

  • The visual style of the progress indicator.

    Declaration

    Swift

    enum UIActivityIndicatorViewStyle : Int { case WhiteLarge case White case Gray }

    Objective-C

    typedef enum { UIActivityIndicatorViewStyleWhiteLarge, UIActivityIndicatorViewStyleWhite, UIActivityIndicatorViewStyleGray, } UIActivityIndicatorViewStyle;

    Constants

    • WhiteLarge

      UIActivityIndicatorViewStyleWhiteLarge

      The large white style of indicator.

      Available in iOS 2.0 and later.

    • White

      UIActivityIndicatorViewStyleWhite

      The standard white style of indicator (the default).

      Available in iOS 2.0 and later.

    • Gray

      UIActivityIndicatorViewStyleGray

      The standard gray style of indicator.

      Available in iOS 2.0 and later.

    Discussion

    You set the value of the activityIndicatorViewStyle property with these constants.

    Import Statement

    Swift

    import UIKit

    Availability

    Available in iOS 2.0 and later.