Mac Developer Library

Developer

AppKit Framework Reference NSProgressIndicator Class Reference

Options
Deployment Target:

On This Page
Language:

NSProgressIndicator

The NSProgressIndicator class lets an application display a progress indicator to show that a lengthy task is under way. Some progress indicators are indeterminate and do nothing more than spin to show that the application is busy. Others are determinate and show the percentage of the task that has been completed.

  • Starts the animation of an indeterminate progress indicator.

    Declaration

    Swift

    func startAnimation(_ sender: AnyObject?)

    Objective-C

    - (void)startAnimation:(id)sender

    Parameters

    sender

    The object sending the message.

    Discussion

    Does nothing for a determinate progress indicator.

    Availability

    Available in OS X v10.0 and later.

  • Stops the animation of an indeterminate progress indicator.

    Declaration

    Swift

    func stopAnimation(_ sender: AnyObject?)

    Objective-C

    - (void)stopAnimation:(id)sender

    Parameters

    sender

    The object sending the message.

    Discussion

    Does nothing for a determinate progress indicator.

    Availability

    Available in OS X v10.0 and later.

  • A Boolean that indicates whether the progress indicator implements animation in a separate thread.

    Declaration

    Swift

    var usesThreadedAnimation: Bool

    Objective-C

    @property BOOL usesThreadedAnimation

    Discussion

    When the value of this property is YEStrue, animation of the progress indicator occurs in a separate thread.

    If the application becomes multithreaded as a result of an invocation of this method, the application’s performance could become noticeably slower.

    Availability

    Available in OS X v10.0 and later.

  • Advances the progress bar of a determinate progress indicator by the specified amount.

    Declaration

    Swift

    func incrementBy(_ delta: Double)

    Objective-C

    - (void)incrementBy:(double)delta

    Parameters

    delta

    The amount by which to increment the progress bar. For example, if you want to advance a progress bar from 0.0 to 100.0 in 20 steps, you would invoke incrementBy: 20 times with a delta value of 5.0.

    Availability

    Available in OS X v10.0 and later.

    See Also

    doubleValue

  • The value that indicates the current extent of the progress indicator.

    Declaration

    Swift

    var doubleValue: Double

    Objective-C

    @property double doubleValue

    Discussion

    By default, a determinate progress indicator goes from 0.0 to 100.0. If the progress bar has advanced halfway across the view, this value would be 50.0.

    An indeterminate progress indicator does not use this value.

    Availability

    Available in OS X v10.0 and later.

  • The minimum value for the progress indicator.

    Declaration

    Swift

    var minValue: Double

    Objective-C

    @property double minValue

    Discussion

    By default, a determinate progress indicator goes from 0.0 to 100.0, so the default value of this property is 0.0.

    An indeterminate progress indicator does not use this value.

    Availability

    Available in OS X v10.0 and later.

    See Also

    maxValue

  • The maximum value for the progress indicator.

    Declaration

    Swift

    var maxValue: Double

    Objective-C

    @property double maxValue

    Discussion

    By default, a determinate progress indicator goes from 0.0 to 100.0, so the default value of this property is 100.0.

    An indeterminate progress indicator does not use this value.

    Availability

    Available in OS X v10.0 and later.

    See Also

    minValue

  • The size of the progress indicator.

    Declaration

    Swift

    var controlSize: NSControlSize

    Objective-C

    @property NSControlSize controlSize

    Discussion

    See NSCell for possible values.

    Availability

    Available in OS X v10.0 and later.

  • The progress indicator’s control tint.

    Declaration

    Swift

    var controlTint: NSControlTint

    Objective-C

    @property NSControlTint controlTint

    Discussion

    See NSCell for possible values.

    Availability

    Available in OS X v10.0 and later.

  • A Boolean that indicates whether the progress indicator’s frame has a three-dimensional bezel.

    Declaration

    Swift

    var bezeled: Bool

    Objective-C

    @property(getter=isBezeled) BOOL bezeled

    Discussion

    When the value of this property is YEStrue, the progress indicator is bezeled.

    Availability

    Available in OS X v10.10 and later.

  • A Boolean that indicates whether the progress indicator is indeterminate.

    Declaration

    Swift

    var indeterminate: Bool

    Objective-C

    @property(getter=isIndeterminate) BOOL indeterminate

    Discussion

    A determinate indicator displays how much of the task has been completed. An indeterminate indicator shows simply that the application is busy.

    When the value of this property is YEStrue, the progress indicator is indeterminate.

    This property only has an effect if style returns NSProgressIndicatorBarStyle. If style returns NSProgressIndicatorSpinningStyle, the indicator is always indeterminate, regardless of the value of this property.

    Availability

    Available in OS X v10.10 and later.

  • The style of the progress indicator (bar or spinning).

    Declaration

    Swift

    var style: NSProgressIndicatorStyle

    Objective-C

    @property NSProgressIndicatorStyle style

    Discussion

    See NSProgressIndicatorStyle for possible values.

    Availability

    Available in OS X v10.2 and later.

  • This action method resizes the progress indicator to an appropriate size depending on what style returns.

    Declaration

    Swift

    func sizeToFit()

    Objective-C

    - (void)sizeToFit

    Discussion

    Use this after you use style to re-size the progress indicator.

    Availability

    Available in OS X v10.2 and later.

  • A Boolean that indicates whether the progress indicator hides itself when it isn’t animating.

    Declaration

    Swift

    var displayedWhenStopped: Bool

    Objective-C

    @property(getter=isDisplayedWhenStopped) BOOL displayedWhenStopped

    Discussion

    When the value of this property is YEStrue, the progress indicator is hidden when it isn't animating. The default value of this property is YEStrue if style is NSProgressIndicatorBarStyle, and NOfalse if style is NSProgressIndicatorSpinningStyle.

    Availability

    Available in OS X v10.10 and later.

  • - animate: (OS X v10.5) and later

    This action method advances the progress animation of an indeterminate progress animator by one step.

    Deprecation Statement

    NSProgressIndicator no longer supports incrementing the animation using this method. Use the startAnimation: and stopAnimation: methods to perform animation of the progress indicator.

    Declaration

    Objective-C

    - (void)animate:(id)sender

    Parameters

    sender

    The object sending the message.

    Availability

    Deprecated in OS X v10.5 and later.

  • - animationDelay (OS X v10.5) and later

    Returns the delay, in seconds, between animation steps for an indeterminate progress indicator.

    Deprecation Statement

    Progress indicators no longer allow the animation delay to be set.

    Declaration

    Objective-C

    - (NSTimeInterval)animationDelay

    Return Value

    The delay between animation steps. By default, the animation delay is set to 1/12 of a second (5.0/60.0). A determinate progress indicator does not use the animation delay value.

    Availability

    Deprecated in OS X v10.5 and later.

  • Sets the delay, in seconds, between animation steps for an indeterminate progress indicator.

    Deprecation Statement

    Progress indicators no longer allow the animation delay to be set.

    Declaration

    Objective-C

    - (void)setAnimationDelay:(NSTimeInterval)delay

    Parameters

    delay

    The number of seconds between animation steps. By default, the animation delay is set to 1/12 of a second (5.0/60.0). Setting the delay to a double value larger than 5.0/60.0 slows the animation, while setting the delay to a smaller value speeds it up. A determinate progress indicator does not use the animation delay value.

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.6.

Data Types

  • Specify the height of a progress indicator.

    Declaration

    Swift

    enum NSProgressIndicatorThickness : UInt { case PreferredThickness case PreferredSmallThickness case PreferredLargeThickness case PreferredAquaThickness }

    Objective-C

    typedef enum _NSProgressIndicatorThickness { NSProgressIndicatorPreferredThickness = 14, NSProgressIndicatorPreferredSmallThickness = 10, NSProgressIndicatorPreferredLargeThickness = 18, NSProgressIndicatorPreferredAquaThickness = 12 } NSProgressIndicatorThickness;

    Constants

    • PreferredThickness

      NSProgressIndicatorPreferredThickness

      14

      Available in OS X v10.0 and later.

    • PreferredSmallThickness

      NSProgressIndicatorPreferredSmallThickness

      10

      Available in OS X v10.0 and later.

    • PreferredLargeThickness

      NSProgressIndicatorPreferredLargeThickness

      18

      Available in OS X v10.0 and later.

    • PreferredAquaThickness

      NSProgressIndicatorPreferredAquaThickness

      12

      Available in OS X v10.0 and later.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Specify the progress indicator’s style used by style.

    Declaration

    Swift

    enum NSProgressIndicatorStyle : UInt { case BarStyle case SpinningStyle }

    Objective-C

    typedef enum _NSProgressIndicatorStyle { NSProgressIndicatorBarStyle = 0, NSProgressIndicatorSpinningStyle = 1 } NSProgressIndicatorStyle;

    Constants

    • BarStyle

      NSProgressIndicatorBarStyle

      A rectangular indicator that can be determinate or indeterminate.

      Available in OS X v10.2 and later.

    • SpinningStyle

      NSProgressIndicatorSpinningStyle

      A small square indicator that can be indeterminate only .

      Available in OS X v10.2 and later.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.2 and later.