dmytro-anokhin / url-image

AsyncImage before iOS 15. Lightweight, pure SwiftUI Image view, that displays an image downloaded from URL, with auxiliary views and local cache.
MIT License
1.1k stars 96 forks source link

set a default image, while loading #154

Closed Djibs closed 3 years ago

Djibs commented 3 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

Djibs commented 3 years ago

hello,

Would it be possible to allow the display of an image in the app while waiting for the loading to be finished? Thank you

dmytro-anokhin commented 3 years ago

Hello, sure, you can use inProgress view builder. See View Customization section in the documentation.

Djibs commented 3 years ago

I failed to get "inProgress" to work. You can give me an example.

(I do not yet have a great level in swift / swiftUI )

here is what I did currently:

                            URLImage(URL(string: post.thumbnailApp)) { image in
                                image
                                    .resizable()
                                    .frame(width: 100, height: 79)
                                    .cornerRadius(3.0)
                            }.environment(\.urlImageService, urlImageService)