関数内でカスタマイズ可能な 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)
}