How to change the Push and Pop animations in a navigation based app

前端 未结 25 1416
清酒与你
清酒与你 2020-11-22 12:46

I have a navigation based application and I want to change the animation of the push and pop animations. How would I do that?

Edit 2018

Ther

25条回答
  •  执念已碎
    2020-11-22 12:57

    You can now use UIView.transition. Note that animated:false. This works with any transition option, pop, push, or stack replace.

    if let nav = self.navigationController
    {
        UIView.transition(with:nav.view, duration:0.3, options:.transitionCrossDissolve, animations: {
            _ = nav.popViewController(animated:false)
        }, completion:nil)
    }
    

提交回复
热议问题