Reputation: 58
I have an srollview with many images. After some image had touched I should open new view controller with this image and related images for image that was touched. Now I use pushViewController.
So question is. Is it possible to open new viewController wiht zoom animation? i.e. after user touched image, this image is zooming into the center of the screen (and this is new viewController already)
If it's possible please let me know with what I can realise it.
Thanks
Upvotes: 0
Views: 424
Reputation: 41642
I have good news and bad news for you. The good news is yes, it can be done! The bad news is that it can be complex.
The way I ended up doing it was as follows
when the user taps the image, you know what image to zoom, and you grab a reference and a frame
overlay a new view over the current view containing the scrollView, then add a NEW UIImageView containing another UIImage of the one the user tapped (could even be a higher resolution version)
animate that view to fill the screen (this image can be in a zoomable scrollview too, that's for future work!)
when you want to dismiss, you animate the frame down to be exactly whats in the scrollView, then you remove the overlay view
now users is more or less back to where they were before the tap
Upvotes: 1