Skip to content

Commit bcb871a

Browse files
committed
Update the readme about the animation control binding
1 parent b62cbdf commit bcb871a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,24 @@ var body: some View {
8585
```swift
8686
var body: some View {
8787
Group {
88-
AnimatedImage(url: URL(string: "https://raw.githubusercontent.com/liyong03/YLGIFImage/master/YLGIFImageDemo/YLGIFImageDemo/joy.gif")) // Network
88+
// Network
89+
AnimatedImage(url: URL(string: "https://raw.githubusercontent.com/liyong03/YLGIFImage/master/YLGIFImageDemo/YLGIFImageDemo/joy.gif"))
8990
.onFailure(perform: { (error) in
9091
// Error
9192
})
9293
.scaledToFit()
93-
AnimatedImage(data: try! Data(contentsOf: URL(fileURLWithPath: "/tmp/foo.webp"))) // Data
94+
// Data
95+
AnimatedImage(data: try! Data(contentsOf: URL(fileURLWithPath: "/tmp/foo.webp")))
9496
.customLoopCount(1)
95-
AnimatedImage(name: "animation1") // Bundle (not Asset Catalog)
97+
// Bundle (not Asset Catalog)
98+
AnimatedImage(name: "animation1", isAnimating: $isAnimating)) // Animation control binding
9699
.maxBufferSize(.max)
97100
}
98101
}
99102
```
100103

101104
- [x] Supports network image as well as local data and bundle image
105+
- [x] Supports animation control using the SwiftUI Binding
102106
- [x] Supports advanced control like loop count, incremental load, buffer size.
103107

104108
Note: `AnimatedImage` supports both image url or image data for animated image format. Which use the SDWebImage's [Animated ImageView](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#animated-image-50) for internal implementation.

0 commit comments

Comments
 (0)