Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way integrate Kingfisher (or any image loading library) with ImageScrollView #72

Open
yccheok opened this issue Jul 5, 2022 · 0 comments

Comments

@yccheok
Copy link

yccheok commented Jul 5, 2022

Thank you for providing ImageScrollView. This really work well if

  • The image is local
  • Width and height of image is known

We can use this function to display the image - https://github.com/huynguyencong/ImageScrollView/blob/master/Sources/ImageScrollView.swift#L178

But, what if

  1. We need to first display a low resolution image from local as placeholder
  2. We tend need to fetch a high resolution image over the Internet. Once fetch is done, high resolution image will replace the placeholder display (Seamlessly so that user does not notice any flickering or glitch)
  3. The width and height of the high resolution internet image is not known before fetching

If we do not use ImageScrollView, but using standard UIImageView, this can be achieved via image loading library

let url = URL(string: "https://example.com/high_resolution_image.png")
imageView.kf.setImage(
    with: url,
    placeholder: UIImage(named: "placeholderImage")
)

Since ImageScrollView does not expose its internal UIImageView, may I know what is the good way to integrate Kingfisher (or any image loading library) with it?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant