Skip to content

ProgressViewStyle

kkla320 edited this page Oct 18, 2021 · 2 revisions

Extensions on ProgressViewStyle

Methods

gauge(thickness:)

A progress view that visually indicates its progress using a gauge.

public static func gauge(thickness: CGFloat = 12) -> GaugeProgressViewStyle<AngularGradient, EmptyView, EmptyView> where Self == GaugeProgressViewStyle<AngularGradient, EmptyView, EmptyView> 

Parameters

  • thickness: The thickness of the gauge.

Returns

A view representing the body of a progress view with traffic light angular gradient and no labels for the lowest and highest value.

gauge(thickness:lowerLabel:upperLabel:)

A progress view that visually indicates its progress using a gauge.

public static func gauge<LowerLabel: View, UpperLabel: View>(
        thickness: CGFloat = 12,
        @ViewBuilder lowerLabel: @escaping () -> LowerLabel,
        @ViewBuilder upperLabel: @escaping () -> UpperLabel
    ) -> GaugeProgressViewStyle<AngularGradient, LowerLabel, UpperLabel> where Self == GaugeProgressViewStyle<AngularGradient, LowerLabel, UpperLabel> 

Parameters

  • thickness: The thickness of the gauge.
  • lowerLabel: A view builder that creates a view that describes the lowest value of the gauge.
  • upperLabel: A view builder that creates a view that describes the highest value of the gauge.

Returns

A view representing the body of a progress view with traffic light angular gradient and a minimum and maximum label.

gauge(shape:thickness:)

A progress view that visually indicates its progress using a gauge.

public static func gauge<S: ShapeStyle & View>(shape: S, thickness: CGFloat = 12) -> GaugeProgressViewStyle<S, EmptyView, EmptyView> where Self == GaugeProgressViewStyle<S, EmptyView, EmptyView> 

Parameters

  • shape: The shape used for coloring the gauge.
  • thickness: The thickness of the gauge.

Returns

A view representing the body of a progress view with the shape and no labels for the lowest and highest value.

gauge(shape:thickness:lowerLabel:upperLabel:)

A progress view that visually indicates its progress using a gauge.

public static func gauge<S: ShapeStyle & View, LowerLabel: View, UpperLabel: View>(
        shape: S,
        thickness: CGFloat = 12,
        @ViewBuilder lowerLabel: @escaping () -> LowerLabel,
        @ViewBuilder upperLabel: @escaping () -> UpperLabel
    ) -> GaugeProgressViewStyle<S, LowerLabel, UpperLabel> where Self == GaugeProgressViewStyle<S, LowerLabel, UpperLabel> 

Parameters

  • shape: The shape used for coloring the gauge.
  • thickness: The thickness of the gauge.
  • lowerLabel: A view builder that creates a view that describes the lowest value of the gauge.
  • upperLabel: A view builder that creates a view that describes the highest value of the gauge.

Returns

A view representing the body of a progress view with the shape and a minimum and maximum label.