Skip to content

Commit f2a7b99

Browse files
committed
Use the generic signature for ProgressiveStyle
This match Apple's API
1 parent 63e1aeb commit f2a7b99

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Example/SDWebImageSwiftUIDemo/DetailView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ struct DetailView: View {
111111
WebImage(url: URL(string:url), options: [.progressiveLoad, .delayPlaceholder], isAnimating: $isAnimating)
112112
.resizable()
113113
.placeholder(.wifiExclamationmark)
114-
.indicator(.progress)
114+
.indicator(.progress(style: .circular))
115115
.scaledToFit()
116116
}
117117
}

SDWebImageSwiftUI/Classes/Indicator/Indicator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ extension Indicator where T == AnyView {
7171

7272
/// Activity Indicator with style
7373
/// - Parameter style: style
74-
public static func activity(style: any ProgressViewStyle) -> Indicator<T> {
74+
public static func activity<S>(style: S) -> Indicator<T> where S: ProgressViewStyle {
7575
Indicator { isAnimating, _ in
7676
AnyView(ProgressView().progressViewStyle(style).opacity(isAnimating.wrappedValue ? 1 : 0))
7777
}
@@ -89,7 +89,7 @@ extension Indicator where T == AnyView {
8989

9090
/// Progress Indicator with style
9191
/// - Parameter style: style
92-
public static func progress(style: any ProgressViewStyle) -> Indicator<T> {
92+
public static func progress<S>(style: S) -> Indicator<T> where S: ProgressViewStyle {
9393
Indicator { isAnimating, progress in
9494
AnyView(ProgressView(value: progress.wrappedValue).progressViewStyle(style).opacity(isAnimating.wrappedValue ? 1 : 0))
9595
}

0 commit comments

Comments
 (0)