@@ -148,26 +148,30 @@ public struct AsyncImage<Content>: View where Content : View {
148148 /// to the loaded image, use the ``init(url:scale:content:placeholder:)``
149149 /// initializer instead.
150150 ///
151- /// > Warning: Due to limitations in SwiftUI's public API, `Image.redacted`
152- /// > cannot be fully implemented in this backport. As a result, the default
153- /// > placeholder effect in this initializer will appear different from SwiftUI's
154- /// > native implementation. For a more consistent appearance across platforms,
155- /// > consider using the `init(url:scale:content:placeholder:)` initializer
156- /// > with a custom placeholder instead.
157- ///
158151 /// - Parameters:
159152 /// - url: The URL of the image to display.
160153 /// - scale: The scale to use for the image. The default is `1`. Set a
161154 /// different value when loading images designed for higher resolution
162155 /// displays. For example, set a value of `2` for an image that you
163156 /// would name with the `@2x` suffix if stored in a file on disk.
164- @available ( * , deprecated, message: " Use `init(url:scale:transaction:content:)` or `init(url:scale: content:placeholder:) instead. " )
157+ @available ( * , deprecated, message: " Use `init(url:scale:content:placeholder:) instead. " )
165158 public init ( url: URL ? , scale: CGFloat = 1 ) where Content == Image {
166159 self . url = url
167160 self . scale = scale
168161 self . transaction = Transaction ( )
169162 self . content = { phase in
170- phase. image ?? . redacted
163+ if let image = phase. image {
164+ return image
165+ } else if let redacted = Image . redacted {
166+ return redacted
167+ } else {
168+ Log . runtimeIssues ( #"""
169+ Image.redacted is unavailable on this OS version (Available on iOS 18.x any may be available on future OS).
170+ This fallback uses an empty image, which does not match SwiftUI's native placeholder appearance.
171+ For consistent cross-platform behavior, use init(url:scale:content:placeholder:) with a custom placeholder view.
172+ """# )
173+ return Image ( " " )
174+ }
171175 }
172176 }
173177
0 commit comments