Skip to content

Commit f4a03dc

Browse files
committed
Update the Demo for watchOS, added tooltip
1 parent 532ca91 commit f4a03dc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Example/SDWebImageSwiftUIDemo/ContentView.swift

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class UserSettings: ObservableObject {
1717
#endif
1818
}
1919

20+
#if os(watchOS)
2021
@available(iOS 14.0, OSX 11.0, tvOS 14.0, watchOS 7.0, *)
2122
extension Indicator where T == ProgressView<EmptyView, EmptyView> {
2223
static var activity: Indicator {
@@ -31,6 +32,7 @@ extension Indicator where T == ProgressView<EmptyView, EmptyView> {
3132
}
3233
}
3334
}
35+
#endif
3436

3537
struct ContentView: View {
3638
@State var imageURLs = [
@@ -143,6 +145,7 @@ struct ContentView: View {
143145
.transition(.fade(duration: 0.5))
144146
.scaledToFit()
145147
.frame(width: CGFloat(100), height: CGFloat(100), alignment: .center)
148+
.help(url)
146149
#endif
147150
} else {
148151
WebImage(url: URL(string:url), isAnimating: .constant(true))
@@ -156,6 +159,7 @@ struct ContentView: View {
156159
.transition(.fade(duration: 0.5))
157160
.scaledToFit()
158161
.frame(width: CGFloat(100), height: CGFloat(100), alignment: .center)
162+
.help(url)
159163
}
160164
Text((url as NSString).lastPathComponent)
161165
}

0 commit comments

Comments
 (0)