-
Notifications
You must be signed in to change notification settings - Fork 80
Description
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)
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.