LazyImage(source: imageUrl) { state in
if let image = state.image {
image
} else if state.error != nil {
Image(systemName: "xmark.octagon")
.resizable()
.padding()
.scaledToFit()
.foregroundColor(.red)
} else {
ProgressView()
}
}
and it works just fine for images. However if the imageUrl is a video then nothing is displayed.
If I remove the trailing closure then the video shows up but then I loose my error icon & loading indicator.
I didn't see anything related to videos in LazyImageState. How can I make this work?
I'm using LazyImage like so:
and it works just fine for images. However if the
imageUrl
is a video then nothing is displayed. If I remove the trailing closure then the video shows up but then I loose my error icon & loading indicator. I didn't see anything related to videos inLazyImageState
. How can I make this work?