I'm using a pinch gesture to interactively transition from a UIImageView to a ZoomViewController that has the same UIImageView inside zooming UIScrollView. I update the progress with some modification of the gesture.scale and I have predefined zoom scale for the ZoomViewController. This works great.
Now I want to use the scale at the end of the gesture to be used in the ZoomViewController, i.e. I want the target state to depend on the gesture scale. If I set the scale to the new ZoomViewController the end state after the transition is as expected, but as the transition completes it first animates to it's initially set zoom scale before snapping to the final state.
I expect that I need to modify the final state of the UIImageView, but I can't figure out how to exactly do this. Note that I don't want to apply new modifiers to the animation, just the end state of the animation. I've looked at HeroPlugin but I don't grasp how I should implement this.
I've spent some more time looking into HeroPlugin, but I can only manage to modify the state during transition.
Perhaps I should set a new snapshot for the view, or create a new animator altogether? But it looks like there is no API for this, all those properties are internal.
This is not something that Hero currently support. I wish to do this too. If you are interested in implement this feature, let me know and I can give you some guidance.
Thanks for the response. I'm occupied until the end of the year, but I might help implement this around January. I will be in touch.
Cool, no worry. I might find some time to implement this.
Hello lkzhao,
I'm working with fulco v on this project and we are planning on implementing this feature. Guidance will definitely be helpful so we're looking forward to hearing from you about this.
Kind regards, Menno
Hi Luke,
As Menno mentioned above we're looking to implement this above mentioned feature into Hero. Menno will be having a look by himself with some of my findings from working with Hero a few months ago. However, any directions from you will definitely be helpful, so if you can find some time, please do :)
Best regards,
Fulco
Hi @fulcov, @mennolovink
you mentioned
I've spent some more time looking into HeroPlugin, but I can only manage to modify the state during the transition.
How did you do it? I need to change the state during a transition too, but I don't have a clue.
Thanks :)
We've opted to implement an entirely different approach. Our use-case was around zoom behavior specifically, and @mennolovink wrote Zoomy to do what we wanted: https://github.com/mennolovink/Zoomy
EDIT: I may have misunderstood your question. I've never pulled off significant under the hood magic with Hero. All the state adjustments during transitions, I did by way of the Hero.shared instance as described in the documentation on interactive transitions.
Most helpful comment
We've opted to implement an entirely different approach. Our use-case was around zoom behavior specifically, and @mennolovink wrote Zoomy to do what we wanted: https://github.com/mennolovink/Zoomy
EDIT: I may have misunderstood your question. I've never pulled off significant under the hood magic with Hero. All the state adjustments during transitions, I did by way of the
Hero.sharedinstance as described in the documentation on interactive transitions.