viewController(forKey:)
Returns the view controllers involved in the transition.
Declaration
func viewController(forKey key: UITransitionContextViewControllerKey) -> UIViewController?Parameters
- key:
The key indicating which view controller you want. For a list of possible values, see Uitransitioncontextviewcontrollerkey.
Return Value
The view controller associated with the key.
Discussion
The view controller associated with the from key corresponds to the view controller that’s already onscreen. The view controller associated with the to key corresponds to the view controller that’s to be animated onscreen.