SDWebImage / SDWebImageSwiftUI

SwiftUI Image loading and Animation framework powered by SDWebImage
https://sdwebimage.github.io/SDWebImageSwiftUI
MIT License
2.18k stars 224 forks source link

Removed placeholder - how to replace it #327

Closed salvatoreboemia closed 3 months ago

salvatoreboemia commented 3 months ago

Hi

how I can replace it?

Thanks

dreampiggy commented 3 months ago

Use content: placeholder: closure API.

Just like AsyncImage, see Apple's usage

dreampiggy commented 3 months ago

https://stackoverflow.com/questions/75088942/adding-a-placeholder-to-asyncimage-and-showing-a-different-image-if-asyncimage-f

dreampiggy commented 3 months ago

The readme already contains some example using placeholder via WebImage: https://github.com/SDWebImage/SDWebImageSwiftUI?tab=readme-ov-file#using-webimage-to-load-network-image