Skip to content

Commit 81a6dc3

Browse files
committed
Update the readme with different indicator and transition API for WebImage/AnimatedImage
1 parent 7b5f7b8 commit 81a6dc3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Example/SDWebImageSwiftUIDemo/ContentView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ struct ContentView: View {
9898
WebImage(url: URL(string:url))
9999
.resizable()
100100
.indicator(.activity)
101-
.scaledToFit()
102-
.frame(width: CGFloat(100), height: CGFloat(100), alignment: .center)
103101
.animation(.easeInOut(duration: 0.5))
104102
.transition(.fade)
103+
.scaledToFit()
104+
.frame(width: CGFloat(100), height: CGFloat(100), alignment: .center)
105105
#else
106106
WebImage(url: URL(string:url))
107107
.resizable()

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ var body: some View {
7575
}
7676
.resizable()
7777
.indicator(.activity) // Activity Indicator
78+
.animation(.easeInOut(duration: 0.5))
79+
.transition(.fade) // Fade Transition
7880
.scaledToFit()
7981
.frame(width: 300, height: 300, alignment: .center)
8082
}
@@ -90,6 +92,7 @@ var body: some View {
9092
.onFailure { error in
9193
// Error
9294
}
95+
.indicator(SDWebImageActivityIndicator.medium) // Activity Indicator
9396
.transition(.fade) // Fade Transition
9497
.scaledToFit()
9598
// Data
@@ -104,7 +107,7 @@ var body: some View {
104107

105108
- [x] Supports network image as well as local data and bundle image
106109
- [x] Supports animation control using the SwiftUI Binding
107-
- [x] Supports indicator and transition powered by SDWebImage and CoreAnimation
110+
- [x] Supports indicator and transition powered by SDWebImage and CoreAnimation API
108111
- [x] Supports advanced control like loop count, incremental load, buffer size
109112
- [x] Supports coordinate with native UIKit/AppKit/WKInterface view
110113

0 commit comments

Comments
 (0)