Hero: Different Hero Modifer on Presenting, Pushing / Dismissing, Popping

Created on 4 Sep 2018  路  3Comments  路  Source: HeroTransitions/Hero

Is there any way I can make my subview to animate differently depending if it is appearing or disappearing?

Imagine I have a view with a rectangle subview, I want the rectangle to scale up when appearing, and scale down when disappearing.

IS there any way how can I do it?

subView.hero.modifiers = [ .when({ context in return context.isAppearing }, .scale(10)), .when({ context in return context.isDisappearing }, .scale(0.1)) ]

isAppearing and isDisappearing does not exist in context. Above is just an example, I have a more complex animation currently.

I have to set modifiers each time I am doing presentViewController, pushViewController, popViewController, dismissViewController, I am wondering if it is possible to do it just once on load

All 3 comments

bumpppp

bumppppp

bump

Was this page helpful?
0 / 5 - 0 ratings