CreationKit Documentation

Class Activity​Indicator

public class ActivityIndicator: UIControl  

ActivityIndicators express an unspecified wait time or display the length of a process.

Prefer to use make(style:) instead of init(style:).

ActivityIndicator can have one of two styles:

  • linear - displayed as a line

  • circular - displayed as a circle

For a determinate progress indicator, use an instance of the ProgressIndicator class.

AutoLayout & Constraints

The design system specifies the heights and optionally the width of this type. When using a linear style, the height will be constrained to 4 points, where as the circular style will constrain the height and width to 40 points.

DO NOT place any constraints that may conflict with these constraints.

The only exception to this is when placing an indicator in an accessory view where it's safe to specify a frame and not use constraints. If you pass anything other than .zero into the init(style:,frame:) constructor, CreationKit will NOT place constraints for you. You mostly likely won't have to use this feature as CreationKit already handles this internally when needed on Forms.

ActivityIndicator ActivityIndicator UIControl UIControl ActivityIndicator->UIControl NetworkActivityIndicator NetworkActivityIndicator NetworkActivityIndicator->ActivityIndicator

Nested Types

ActivityIndicator.Style

The styles ActivityIndicator supports.

Subclasses

NetworkActivityIndicator

A replacement for the systems deprecated network activity indicator. Ensure to call NetworkActivityIndicator.configure() when your app starts to properly track status bar tint changes.

Conforms To

UIControl

Initializers

init(style:​frame:​)

public init(style: Style, frame: CGRect = .zero)  

Creates a new ActivityIndicator with a specified style. Prefer to use make(style:) instead.

For a determinate progress indicator, use an instance of the ProgressIndicator class.

Parameters

style Style

The Style of ActivityIndicator you want, linear or circular.

frame CGRect

A frame to set the indicator in. You most likely don't need to set this. This is only useful in cases where you don't need constraints, such as in an accessory view on an input field. Defaults to .zero.

Properties

is​Animating

public var isAnimating: Bool  

tint​Color

public override var tintColor: UIColor!  

The color of the view progress indicator.

track​Color

public var trackColor: UIColor = ColorManager.shared.progressIndicatorTrack  

The color of the track the progress indicator follows.

Methods

make(style:​frame:​)

public static func make(style: Style, frame: CGRect = .zero) -> ActivityIndicator  

Creates a new ActivityIndicator with a specified style.

For a determinate progress indicator, use an instance of the ProgressIndicator class.

Parameters

style Style

The Style of ActivityIndicator you want, linear or circular.

frame CGRect

A frame to set the indicator in. You most likely don't need to set this. This is only useful in cases where you don't need constraints, such as in an accessory view on an input field. Defaults to .zero.

start()

public func start()  

Starts the animation of the progress indicator.

stop()

public func stop()  

Stops the animation of the progress indicator. Will hide the indicator.