HeroTransitions / Hero

Elegant transition library for iOS & tvOS
https://HeroTransitions.github.io/Hero/
MIT License
22.03k stars 1.72k forks source link

Replace view direction #382

Closed boardmain closed 2 years ago

boardmain commented 6 years ago

hi how to set the direction on replaceviewcontroller?

i see setDefaultAnimationForNextTransition was removed?

i tried to set defaultanimation on shared hero and in the vc but with now sucess always the vc enter from right

how to change it?

abdollahzakeri commented 6 years ago

hi. i use this function to do a hero segue : func heroSegue(destination:String , animation:HeroDefaultAnimationType) { let destinationVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: destination) destinationVC.isHeroEnabled = true destinationVC.heroModalAnimationType = animation self.hero_replaceViewController(with: destinationVC) }

and use it like this : heroSegue(destination: "verificationCodeVC", animation: .cover(direction: .left)) you can change the animation and direction easily like this : heroSegue(destination: "verificationCodeVC", animation: .slide(direction: .right))