Skip to content

Commit 3d43d8b

Browse files
committed
Update some readme about the usage and demo
1 parent eaf9013 commit 3d43d8b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,10 @@ Note: This `WebImage` using `Image` for internal implementation, which is the be
132132
Note: The `WebImage` animation provide common use case, so it's still recommend to use `AnimatedImage` for advanced controls like progressive animation rendering.
133133

134134
```swift
135+
@State var isAnimating: Bool = true
135136
var body: some View {
136137
WebImage(url: URL(string: "https://raw.githubusercontent.com/liyong03/YLGIFImage/master/YLGIFImageDemo/YLGIFImageDemo/joy.gif"), isAnimating: $isAnimating)) // Animation Control, supports dynamic changes
137-
// The initial value of binding should be true (or you can use `.animatedImageClass` context option and pass `SDAnimatedImage`)
138+
// The initial value of binding should be true
138139
.customLoopCount(1) // Custom loop count
139140
.playbackRate(2.0) // Playback speed rate
140141
// `WebImage` supports advanced control just like `AnimatedImage`, but without the progressive animation support
@@ -175,6 +176,7 @@ var body: some View {
175176
.maxBufferSize(.max)
176177
.onViewUpdate { view, context in // Advanced native view coordinate
177178
view.toolTip = "Mouseover Tip"
179+
let coordinator = context.coordinator
178180
}
179181
}
180182
}
@@ -198,7 +200,7 @@ Why we have two different View types here, is because of current SwiftUI limit.
198200

199201
If you don't need animated image, prefer to use `WebImage` firstly. Which behaves the seamless as built-in SwiftUI View. If SwiftUI works, it works.
200202

201-
If you need simple animated image, use `WebImage`. Which provide the basic animated image support. But it does not support progressive animation rendering, playback rate, etc.
203+
If you need simple animated image, use `WebImage`. Which provide the basic animated image support. But it does not support progressive animation rendering, if you don't care about this.
202204

203205
If you need powerful animated image, `AnimatedImage` is the one to choose. Remember it supports static image as well, you don't need to check the format, just use as it.
204206

@@ -396,7 +398,7 @@ Demo Tips:
396398

397399
1. Use `Switch` (right-click on macOS/force press on watchOS) to switch between `WebImage` and `AnimatedImage`.
398400
2. Use `Reload` (right-click on macOS/force press on watchOS) to clear cache.
399-
3. Use `Swipe To Delete` (menu button on tvOS) to delete one image url from list.
401+
3. Use `Swipe Left` (menu button on tvOS) to delete one image url from list.
400402
4. Pinch gesture (Digital Crown on watchOS, play button on tvOS) to zoom-in detail page image.
401403
5. Clear cache and go to detail page to see progressive loading.
402404

0 commit comments

Comments
 (0)