Update the readme with more example code

This commit is contained in:
DreamPiggy 2019-10-05 15:12:25 +08:00
parent 840b6725b5
commit d23f9b4bb0
1 changed files with 4 additions and 2 deletions

View File

@ -85,13 +85,15 @@ var body: some View {
```swift ```swift
var body: some View { var body: some View {
Group { Group {
AnimatedImage(url: URL(string: "https://raw.githubusercontent.com/liyong03/YLGIFImage/master/YLGIFImageDemo/YLGIFImageDemo/joy.gif")) AnimatedImage(url: URL(string: "https://raw.githubusercontent.com/liyong03/YLGIFImage/master/YLGIFImageDemo/YLGIFImageDemo/joy.gif")) // Network
.onFailure(perform: { (error) in .onFailure(perform: { (error) in
// Error // Error
}) })
.scaledToFit() .scaledToFit()
AnimatedImage(data: try! Data(contentsOf: URL(fileURLWithPath: "/tmp/foo.webp"))) AnimatedImage(data: try! Data(contentsOf: URL(fileURLWithPath: "/tmp/foo.webp"))) // Data
.customLoopCount(1) .customLoopCount(1)
AnimatedImage(name: "animation1") // Bundle (not Asset Catalog)
.maxBufferSize(.max)
} }
} }
``` ```