JanGorman / Agrume

🍋 A lemony fresh iOS image viewer written in Swift.
MIT License
807 stars 121 forks source link

Allow replacing an image while maintaining the zoom scale and position #284

Closed ba01ei closed 3 years ago

ba01ei commented 3 years ago

Thanks so much for building this amazing library! Could you please consider this change to support the image replacing use case?

Imagine you start an Agrume with a lower resolution image which was already loaded and cached, and now you want to download a higher resolution copy and replace it once the high resolution image is ready. This change allows replacing between URL based image and UIImage, and allows the replacing process to maintain the zoom scale and position, so it doesn't interrupt the user's flow.

Please see the video demo (included in the Example app as well):

https://user-images.githubusercontent.com/1700014/133555632-e92d9df1-a74a-41ba-9824-7e3ced600fab.mov

JanGorman commented 3 years ago

Thanks for opening the PR! 🎉 I just got back from vacation and have a lot of catching up to do – I'll review the changes later today

ba01ei commented 3 years ago

Thanks for opening the PR! 🎉 I just got back from vacation and have a lot of catching up to do – I'll review the changes later today

Thanks a lot for the review @JanGorman! I just applied the changes you suggested, and did a sanity check and made sure that everything still works.

JanGorman commented 3 years ago

Thanks @ba01ei – much appreciated

ba01ei commented 3 years ago

Thanks @ba01ei – much appreciated

No problem, and thanks a lot for merging the change!