Class
ActivityIndicator
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.
Relationships
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
Name | Type | Description |
---|---|---|
style | Style |
The Style of |
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
isAnimating
public var isAnimating: Bool
trackColor
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
Name | Type | Description |
---|---|---|
style | Style |
The Style of |
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. |