AlamofireImage icon indicating copy to clipboard operation
AlamofireImage copied to clipboard

Basic SwiftUI support

Open alexdremov opened this issue 3 years ago • 4 comments

Issue Link :link:

https://github.com/Alamofire/AlamofireImage/issues/430

Goals :soccer:

  • Implement basic SwiftUI view for images lazy download
  • Documentation

Implementation Details :construction:

  • Created LazyImage view that loads image from URL and displays placeholder while loading it
  • For optimisation and elegant LazyImage instantiation LazyImageDownloader is created

Looking forward to your comments and advices! Really wanted to make this beautiful framework to support SwiftUI

alexdremov avatar Jun 23 '21 23:06 alexdremov

Thanks for the PR! However, there are a number of improvements that need to be made before we can accept it.

First, it should offer an API surface as similar as possible to the newly added AsyncImage. Ideally users would just need to change the type of the view to migrate between the types.

Second, it needs to include API that allows users to progressively customize the underlying image loading behavior. This would start with simply loading a URL like AsyncImage to being able to take a full ImageDownloader instance.

Third, it should not use AnyView but instead embrace generics to allow the placeholder to be fully defined by a ViewBuilder.

jshier avatar Jul 05 '21 22:07 jshier

Thanks for the reply!

I'll try to implement what you requested and will notify when it's ready

alexdremov avatar Jul 07 '21 10:07 alexdremov

@AlexRoar any update on this? Hoping for some native SwiftUI support so we can utilize this library in our app.

rr-james-hickman avatar Apr 08 '22 19:04 rr-james-hickman

@AlexRoar any update on this? Hoping for some native SwiftUI support so we can utilize this library in our app.

No, have not worked on that one. Found side library for lazy images

alexdremov avatar Apr 08 '22 19:04 alexdremov