有没有一种方法可以轻松地在函数中制作可自定义的 UIModalTranstitionStyle,以便在呈现时可以为多个 viewController 自定义和重用该函数
例子:
func customTransition() -> UIModalTransitionStyle {
//other things here to customize transition
}
只是标准的 .crossdissolve ,.fliphorizontal 和所有这些都不是我需要的,所以我只是想知道你是否可以,因为我用 UIView 做到了
func popIn(yourView : UIView) {
yourView.transform = CGAffineTransform(scaleX: 0.01, y: 0.01)
UIView.animateKeyframes(withDuration: 0.2, delay: 0.0, options: UIViewKeyframeAnimationOptions.calculationModeDiscrete, animations: {
yourView.transform = .identity
}, completion: nil)
self.view.addSubview(yourView)
}