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")
background {
// complete the loading bar after 3 seconds
console.wait(seconds: 3)
loadingBar.succeed()
}
// start the loading bar and wait for it to finish
try loadingBar.start(on: ...).wait()
Topics
Instance Properties
var activity: AThe genericActivityIndicatorTypepowering thisActivityIndicator.
Instance Methods
func fail()Stops theActivityIndicator, yielding a failed / error appearance.func start(refreshRate: Int)Starts theActivityIndicator. Usually this means beginning the associated “loading” animation.func succeed()Stops theActivityIndicator, yielding a success / done appearance.
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype