Instance Method


Asks your delegate for the custom presentation controller to use for managing the view hierarchy when presenting a view controller.


- (UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented presentingViewController:(UIViewController *)presenting sourceViewController:(UIViewController *)source;



The view controller being presented.


The view controller that is presenting the view controller in the presented parameter. The object in this parameter could be the root view controller of the window, a parent view controller that is marked as defining the current context, or the last view controller that was presented. This view controller may or may not be the same as the one in the source parameter. This parameter may also be nil to indicate that the presenting view controller will be determined later.


The view controller whose presentViewController:animated:completion: method was called to initiate the presentation process.

Return Value

The custom presentation controller for managing the modal presentation.


When you present a view controller using the UIModalPresentationCustom presentation style, the system calls this method and asks for the presentation controller that manages your custom style. If you implement this method, use it to create and return the custom presentation controller object that you want to use to manage the presentation process.

If you do not implement this method, or if your implementation of this method returns nil, the system uses a default presentation controller object. The default presentation controller does not add any views or content to the view hierarchy.