Add clarity to code example
This commit is contained in:
parent
92704a2544
commit
bc96b01b8c
11
README.md
11
README.md
|
@ -229,11 +229,18 @@ Note: `AnimatedImage` some methods like `.transition`, `.indicator` and `.aspect
|
|||
Note: some of methods on `AnimatedImage` will return `some View`, a new Modified Content. You'll lose the type related modifier method. For this case, you can either reorder the method call, or use Native View in `.onViewUpdate` for rescue.
|
||||
|
||||
```swift
|
||||
|
||||
// Using UIKit components
|
||||
var body: some View {
|
||||
AnimatedImage(name: "animation2.gif") // Just for showcase, don't mix them at the same time
|
||||
AnimatedImage(name: "animation2.gif")
|
||||
.indicator(SDWebImageProgressIndicator.default) // UIKit indicator component
|
||||
.indicator(Indicator.progress) // SwiftUI indicator component
|
||||
.transition(SDWebImageTransition.flipFromLeft) // UIKit animation transition
|
||||
}
|
||||
|
||||
// Using SwiftUI components
|
||||
var body: some View {
|
||||
AnimatedImage(name: "animation2.gif")
|
||||
.indicator(Indicator.progress) // SwiftUI indicator component
|
||||
.transition(AnyTransition.flipFromLeft) // SwiftUI animation transition
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue