diff --git a/Example/SDWebImageSwiftUIDemo/DetailView.swift b/Example/SDWebImageSwiftUIDemo/DetailView.swift index f9e7dea..1c2b723 100644 --- a/Example/SDWebImageSwiftUIDemo/DetailView.swift +++ b/Example/SDWebImageSwiftUIDemo/DetailView.swift @@ -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() } } diff --git a/SDWebImageSwiftUI/Classes/Indicator/Indicator.swift b/SDWebImageSwiftUI/Classes/Indicator/Indicator.swift index 499aafd..76113ce 100644 --- a/SDWebImageSwiftUI/Classes/Indicator/Indicator.swift +++ b/SDWebImageSwiftUI/Classes/Indicator/Indicator.swift @@ -71,7 +71,7 @@ extension Indicator where T == AnyView { /// Activity Indicator with style /// - Parameter style: style - public static func activity(style: any ProgressViewStyle) -> Indicator { + public static func activity(style: S) -> Indicator 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 { + public static func progress(style: S) -> Indicator where S: ProgressViewStyle { Indicator { isAnimating, progress in AnyView(ProgressView(value: progress.wrappedValue).progressViewStyle(style).opacity(isAnimating.wrappedValue ? 1 : 0)) }