You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am currently trying to refctor my app from MVVM to ReSwift. One of the things that i adopt is the ReSwiftRouter. The router allows me to navigate from one screen to another (either by push view controller into a navigation controller or by present it modally) .
I also consider to use Hero for animate transition between view controllers.
Hero created some extension to UIViewController which allows you to send a view controller there and animationType and then it will automatically animate the transition between both view controllers.
Now I wanted to know where is the best place to add this transition code? What i did now is to add it to the routable via the following lines of code:
let navigationController = UINavigationController.init(rootViewController: viewController)
self.viewController.hero_replaceViewController(with: navigationController)
return SignUpRoute(viewController)`
I am not sure that this is the best place or not to put the code.
What i was thinking is maybe to write an extension to Routable that will receive the source view controller and the destination view controller and animation type and this function will execute the animation.
Wanted to know what do you think or maybe there is a better solution?
Thanks.
The text was updated successfully, but these errors were encountered:
I was able to leverage Hero for this by presenting my viewcontrollers using modal presentation. Notice that I'm setting hero transition animations on both push and pop, which allows to me to have symmetry. For some reason, using Hero's navigationAnimationType wasn't working, which is why I chose modal presentation, otherwise I would've stuck to show.
Hi,
I am currently trying to refctor my app from MVVM to ReSwift. One of the things that i adopt is the ReSwiftRouter. The router allows me to navigate from one screen to another (either by push view controller into a navigation controller or by present it modally) .
I also consider to use Hero for animate transition between view controllers.
Hero created some extension to UIViewController which allows you to send a view controller there and animationType and then it will automatically animate the transition between both view controllers.
Now I wanted to know where is the best place to add this transition code? What i did now is to add it to the routable via the following lines of code:
` Hero.shared.setDefaultAnimationForNextTransition(.zoom)
Hero.shared.setContainerColorForNextTransition(.lightGray)
I am not sure that this is the best place or not to put the code.
What i was thinking is maybe to write an extension to Routable that will receive the source view controller and the destination view controller and animation type and this function will execute the animation.
Wanted to know what do you think or maybe there is a better solution?
Thanks.
The text was updated successfully, but these errors were encountered: