Skip to content

Commit d186939

Browse files
committed
Fix watchOS demo compile issue
1 parent 1d7efec commit d186939

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Example/SDWebImageSwiftUIDemo/ContentView.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ struct ContentView2: View {
4848
Group {
4949
Text("\(animated ? "AnimatedImage" : "WebImage") - \((imageURLs[imageIndex] as NSString).lastPathComponent)")
5050
Spacer()
51+
#if os(watchOS)
52+
WebImage(url:URL(string: imageURLs[imageIndex]))
53+
.resizable()
54+
.aspectRatio(contentMode: .fit)
55+
#else
5156
if self.animated {
5257
AnimatedImage(url:URL(string: imageURLs[imageIndex]))
5358
.resizable()
@@ -57,6 +62,7 @@ struct ContentView2: View {
5762
.resizable()
5863
.aspectRatio(contentMode: .fit)
5964
}
65+
#endif
6066
Spacer()
6167
Button("Next") {
6268
if imageIndex + 1 >= imageURLs.count {

0 commit comments

Comments
 (0)