lvnkmn / Zoomy

Adds seamless scrollView and instagram like zooming to UIImageViews in any view hierarchy.
MIT License
206 stars 25 forks source link

Question - Placeholder Image #74

Closed kaplanitay closed 4 years ago

kaplanitay commented 4 years ago

Hi,

I would like to load a low quality image as a placeholder until I will bring a high quality image from server. I would like to swap those images at run time. Is that possible some how?

Thanks

lvnkmn commented 4 years ago

Hi @kaplanitay,

Yes It should be, I also do this in my app. The source image for zooming is picked once you start zooming and is retained throughout all of its states (mostly in scroll zoom mode, Insta mode is simpler).

This means you can swap the images on the image view whenever you like, you just won't notice it while zooming.

So if you swap the images during zoom, you will notice it the next time you zoom again. If you swap them before, you should be able to zoom in further right away.

If needed, you can tweak the maximum zoomscale based on the image you're presenting using the zoomsettings. By default it tries to not make the zoomed image too pixelated when fully zoomed in.

Long story short, just set the new .image of the higher quality image one the same UIImageView whenever you desire.

Hope this answers your question.

Cheers.

lvnkmn commented 4 years ago

Closing due to inactivity, feel free to reopen if needed.