Skip to content

Feature request: Making placeholder can receive a ViewBuilder #25

Closed
@dreampiggy

Description

@dreampiggy

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)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions