Class
ActivityIndicator
An instance of a
ActivityIndicatorType that can be started, failed, and succeeded.final class ActivityIndicator<A> where A : ActivityIndicatorType
Overview
Use newActivity(for:) on ActivityIndicatorType to create one.
let loadingBar = console.loadingBar(title: "Loading")
try await foo.withActivityIndicator {
try await Task.sleep(for: .seconds(2.5))
}
Topics
Instance Properties
var activity: AThe genericActivityIndicatorTypepowering thisActivityIndicator.
Instance Methods
func withActivityIndicator(refreshRate:_:)Starts theActivityIndicatorand stops it after the provided body completes.
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype
See Also
Activity
protocol ActivityIndicatorTypeActivityIndicatorTypes are responsible for drawing / rendering the currentActivityIndicatorStateto theConsole.enum ActivityIndicatorStatePossible states to draw / render andActivityIndicatorType.protocol ActivityBarAnActivityIndicatorTypethat renders an activity bar on a single line.struct LoadingBarLoading-style implementation ofActivityBar.struct ProgressBarProgress-style implementation ofActivityBar.struct CustomActivityAn activity indicator with customizable frames and success and failure messages.