有什么方法可以通过自定义屏幕显示来推送视图控制器? ,就像呈现视图控制器modalPresentationStyle = .custom
一样。 !当推送带有自定义动画的视图控制器时,被推送的视图控制器会消失。
您可以在过渡时通过分配所需的动画来推动:
let yourVC = self.storyboard?.instantiateViewController(withIdentifier: "YOURVIEWCONTROLLER") as! YOURVIEWCONTROLLER
UIView.animate(withDuration: 0.6, animations: {() -> Void in
UIView.setAnimationCurve(.easeInOut)
self.navigationController?.pushViewController(yourVC, animated: true)
UIView.setAnimationTransition(.flipFromRight, for: (self.navigationController?.view)!, cache: false)
})