Closed
Description
Current public API, use Image
or UIImage
as a placeholder, which is previouslly in UIKit world. But is not suitable in SwiftUI world.
For SwiftUI, the view is a command to build real view on the screen, there are no subviews like UIKit. So, putting a Image
is not so comfortable.
For example, if I want to add a grey-rounded corner placeholder, I don't need to use a Image
, but a native Rectangle
view.
Usage code:
WebImage(url: url) {
Rectangle()
.foregroundColor(.gray)
}