Complete the code to present a new view controller with a fade transition.
let newVC = UIViewController()
newVC.modalTransitionStyle = [1]
present(newVC, animated: true)The .crossDissolve style creates a fade transition effect when presenting a view controller.
Complete the code to dismiss the current view controller with a slide down transition.
modalTransitionStyle = [1]
dismiss(animated: true)The .coverVertical style slides the view controller down when dismissed.
Fix the error in the code to set a custom transition delegate.
let newVC = UIViewController()
newVC.transitioningDelegate = [1]
present(newVC, animated: true)The transitioning delegate must be an object that implements the UIViewControllerTransitioningDelegate protocol, often self.
Fill both blanks to create a transition animation with a flip effect.
let transition = CATransition() transition.type = [1] transition.subtype = [2] view.window?.layer.add(transition, forKey: nil)
Setting type to "flip" and subtype to "fromLeft" creates a flip animation from left.
Fill all three blanks to create a dictionary for a transition with fade type and duration 0.5.
let options = [ kCATransitionType: [1], kCATransitionSubtype: [2], kCATransitionDuration: [3] ]
This dictionary sets the transition type to fade, direction from right, and duration to half a second.