You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-3Lines changed: 24 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,27 @@ All issue reports, feature requests, contributions, and GitHub stars are welcome
57
57
+ watchOS 6+
58
58
+ Swift 5.1+
59
59
60
+
## SwiftUI 2.0 Compatibility
61
+
62
+
iOS 14(macOS 11) introduce the SwiftUI 2.0, which keep the most API compatible, but changes many internal behaviors, which breaks the SDWebImageSwiftUI's function.
63
+
64
+
From v1.6.0, we adopt SwiftUI 2.0 and iOS 14(macOS 11)'s behavior.You can use `WebImage` and `AnimatedImage` inside the new `LazyVStack`.
65
+
66
+
```swift
67
+
var body: some View {
68
+
ScrollView {
69
+
LazyVStack {
70
+
ForEach(urls, id: \.self) { url in
71
+
AnimatedImage(url: url)
72
+
}
73
+
}
74
+
}
75
+
}
76
+
```
77
+
78
+
Note: However, many differences behavior between iOS 13/14's is hard to fixup. Due to maintain issue, in the future v2.0.0, we will drop the iOS 13 supports and always match SwiftUI 2.0's behavior.
79
+
80
+
60
81
## Installation
61
82
62
83
#### Swift Package Manager
@@ -128,9 +149,7 @@ var body: some View {
128
149
}
129
150
```
130
151
131
-
Note: This `WebImage` using `Image` for internal implementation, which is the best compatible for SwiftUI layout and animation system. But unlike SwiftUI's `Image` which does not support animated image or vector image, `WebImage` supports animated image as well.
132
-
133
-
Note: The `WebImage` animation provide common use case, so it's still recommend to use `AnimatedImage` for advanced controls like progressive animation rendering.
152
+
Note: This `WebImage` using `Image` for internal implementation, which is the best compatible for SwiftUI layout and animation system. But unlike SwiftUI's `Image` which does not support animated image or vector image, `WebImage` supports animated image as well (by defaults from v1.6.0)
134
153
135
154
```swift
136
155
@Statevar isAnimating: Bool=true
@@ -143,6 +162,8 @@ var body: some View {
143
162
}
144
163
```
145
164
165
+
Note: The `WebImage` animation provide common use case, so it's still recommend to use `AnimatedImage` for advanced controls like progressive animation rendering, or vector image rendering. In a word, `WebImage` can render animated image, but not always the best choice.
166
+
146
167
### Using `AnimatedImage` to play animation
147
168
148
169
-[x] Supports network image as well as local data and bundle image
Copy file name to clipboardExpand all lines: SDWebImageSwiftUI/Classes/WebImage.swift
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ public struct WebImage : View {
34
34
/// - Parameter options: The options to use when downloading the image. See `SDWebImageOptions` for the possible values.
35
35
/// - Parameter context: A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
0 commit comments