Use the generic signature for ProgressiveStyle
This match Apple's API
This commit is contained in:
parent
63e1aebbf6
commit
f2a7b99084
|
@ -111,7 +111,7 @@ struct DetailView: View {
|
|||
WebImage(url: URL(string:url), options: [.progressiveLoad, .delayPlaceholder], isAnimating: $isAnimating)
|
||||
.resizable()
|
||||
.placeholder(.wifiExclamationmark)
|
||||
.indicator(.progress)
|
||||
.indicator(.progress(style: .circular))
|
||||
.scaledToFit()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ extension Indicator where T == AnyView {
|
|||
|
||||
/// Activity Indicator with style
|
||||
/// - Parameter style: style
|
||||
public static func activity(style: any ProgressViewStyle) -> Indicator<T> {
|
||||
public static func activity<S>(style: S) -> Indicator<T> where S: ProgressViewStyle {
|
||||
Indicator { isAnimating, _ in
|
||||
AnyView(ProgressView().progressViewStyle(style).opacity(isAnimating.wrappedValue ? 1 : 0))
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ extension Indicator where T == AnyView {
|
|||
|
||||
/// Progress Indicator with style
|
||||
/// - Parameter style: style
|
||||
public static func progress(style: any ProgressViewStyle) -> Indicator<T> {
|
||||
public static func progress<S>(style: S) -> Indicator<T> where S: ProgressViewStyle {
|
||||
Indicator { isAnimating, progress in
|
||||
AnyView(ProgressView(value: progress.wrappedValue).progressViewStyle(style).opacity(isAnimating.wrappedValue ? 1 : 0))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue