Slowing Down Transition of Push Segue

后端 未结 1 726
心在旅途
心在旅途 2021-01-28 14:08

I was wondering if there is a way to slow down \'push segue & back\' like Tinder & Snapchat does. It\'s like normal segue but it\'s somehow transiting slowly.

I

1条回答
  •  时光说笑
    2021-01-28 14:33

    I was wondering if there is a way to slow down 'push segue & back' like Tinder & Snapchat does. It's like normal segue but it's somehow transiting slowly.

    As you've been told, you simply write a custom transition animation. Give the navigation controller a delegate and implement navigationController:animationControllerForOperation:fromViewController:toViewController:. Basically then you just supply an object that implements the UIViewControllerAnimatedTransitioning protocol. As part of that, you get to specify the animation duration.

    enable slowing down segue globally for the whole app?

    If all your navigation controllers have this same delegate, or if all the delegates supply this same UIViewControllerAnimatedTransitioning object, all push / pop transitions will use the same code and will work the same way.

    0 讨论(0)
提交回复
热议问题