Indicator
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
public struct Indicator<T> where T : View
A type to build the indicator
-
Create a indicator with builder
Declaration
Swift
public init(@ViewBuilder content: @escaping (_ isAnimating: Binding<Bool>, _ progress: Binding<Double>) -> T)
Parameters
builder
A builder to build indicator
isAnimating
A Binding to control the animation. If image is during loading, the value is true, else (like start loading) the value is false.
progress
A Binding to control the progress during loading. Value between [0.0, 1.0]. If no progress can be reported, the value is 0. Associate a indicator when loading image with url
-
Activity Indicator
Declaration
Swift
public static var activity: Indicator { get }
-
Activity Indicator with style
Declaration
Swift
public static func activity(style: ActivityIndicator.Style) -> Indicator
Parameters
style
style
-
Progress Indicator
Declaration
Swift
public static var progress: Indicator { get }
-
Progress Indicator with style
Declaration
Swift
public static func progress(style: ProgressIndicator.Style) -> Indicator
Parameters
style
style