I know I can customize dismiss animation using the following code - Dismiss view controller with custom animation?
let transition: CATransition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
transition.type = CATransitionType.reveal
transition.subtype = CATransitionSubtype.fromRight
self.view.window!.layer.add(transition, forKey: nil)
self.dismiss(animated: false, completion: nil)
However, there is only limited of CATransitionType. We would like to achieve the following set of animations
- Move the screen from top-y of screen to middle-y of screen.
- Transparent the screen from alpha 1.0 to 0.0
- Rotate the screen 45 degree by using bottom right screen as pivot
In Android, we can achieve such animations with the following outcome.
I was wondering, in iOS, is it possible to achieve the same outcome when dismissing a ViewController?