Push ViewController from Right To Left with UINavigationController

后端 未结 11 1785
名媛妹妹
名媛妹妹 2020-12-02 11:27

As everyone know the UINavigationController push a ViewController from Left To Right, is there a way to push the View from Right To Left? like the animation for the back but

11条回答
  •  醉酒成梦
    2020-12-02 11:58

    Swift 5.0

     let pageView = TaskFolderListViewController.init(nibName: "HomePageController_iPhone", bundle: nil)
     let transition = CATransition()
     transition.duration = 0.45
     transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.default)
     transition.type = CATransitionType.push
     transition.subtype = CATransitionSubtype.fromLeft
     self.navigationController?.view.layer.add(transition, forKey: kCATransition)
     self.navigationController?.pushViewController(pageView, animated: false)
    

提交回复
热议问题