File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Example/SDWebImageSwiftUIDemo Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,10 @@ struct ContentView: View {
98
98
WebImage ( url: URL ( string: url) )
99
99
. resizable ( )
100
100
. indicator ( . activity)
101
- . scaledToFit ( )
102
- . frame ( width: CGFloat ( 100 ) , height: CGFloat ( 100 ) , alignment: . center)
103
101
. animation ( . easeInOut( duration: 0.5 ) )
104
102
. transition ( . fade)
103
+ . scaledToFit ( )
104
+ . frame ( width: CGFloat ( 100 ) , height: CGFloat ( 100 ) , alignment: . center)
105
105
#else
106
106
WebImage ( url: URL ( string: url) )
107
107
. resizable ( )
Original file line number Diff line number Diff line change @@ -75,6 +75,8 @@ var body: some View {
75
75
}
76
76
.resizable ()
77
77
.indicator (.activity ) // Activity Indicator
78
+ .animation (.easeInOut (duration : 0.5 ))
79
+ .transition (.fade ) // Fade Transition
78
80
.scaledToFit ()
79
81
.frame (width : 300 , height : 300 , alignment : .center )
80
82
}
@@ -90,6 +92,7 @@ var body: some View {
90
92
.onFailure { error in
91
93
// Error
92
94
}
95
+ .indicator (SDWebImageActivityIndicator.medium ) // Activity Indicator
93
96
.transition (.fade ) // Fade Transition
94
97
.scaledToFit ()
95
98
// Data
@@ -104,7 +107,7 @@ var body: some View {
104
107
105
108
- [x] Supports network image as well as local data and bundle image
106
109
- [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
108
111
- [x] Supports advanced control like loop count, incremental load, buffer size
109
112
- [x] Supports coordinate with native UIKit/AppKit/WKInterface view
110
113
You can’t perform that action at this time.
0 commit comments