所以我想自定义Viewcontroller Presentation,因为使用我的代码viewcontroller
冻结了半秒钟,然后显示了其他viewcontroller
。
extension UIViewController {
func presentDetail (_ viewControllerToPresent : UIViewController) {
let transition = CATransition()
transition.duration = 0.3
transition.type = .push
transition.subtype = .fromLeft
self.view.window?.layer.add(transition, forKey: kCATransition)
present(viewControllerToPresent, animated: false, completion: nil)
}
}
答案 0 :(得分:0)
对于自定义演示,您需要在presentedView上提供transitionDelegate,然后提供所需的动画师对象。
可能的最小实现似乎是在func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController?
中提供UIPresentationController