Back Button Animation in Navigation Controller

后端 未结 5 1817
执笔经年
执笔经年 2021-02-10 19:39

CATransitions can be used to animate transitions in Navigation Controllers when drilling down. However when using Back button og Navigation Controller (going back up) animation

5条回答
  •  执念已碎
    2021-02-10 20:01

    Swift 3 version of shadowfax answer:

        let transition:CATransition = CATransition.init()
        transition.duration = 0.75
        transition.timingFunction = CAMediaTimingFunction.init(name: kCAMediaTimingFunctionEaseInEaseOut)
        transition.type = "oglFlip"
        transition.subtype = kCATransitionFromRight
        //transition.delegate = self // not needed
        self.navigationController?.view.layer.add(transition, forKey:nil)
    

提交回复
热议问题