<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIViewControllerTransitioningDelegate/presentationController(forPresented:presenting:source:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIViewControllerTransitioningDelegate(im)presentationControllerForPresentedViewController:presentingViewController:sourceViewController:"
  },
  "title" : "presentationController(forPresented:presenting:source:)"
}
-->

# presentationController(forPresented:presenting:source:)

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

```
optional func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController?
```

## Parameters

`presented`

The view controller being presented.

`presenting`

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.

`source`

The view controller whose [`present(_:animated:completion:)`](/documentation/UIKit/UIViewController/present(_:animated:completion:)) method was called to initiate the presentation process.

## Return Value

The custom presentation controller for managing the modal presentation.

## Discussion

When you present a view controller using the [`UIModalPresentationStyle.custom`](/documentation/UIKit/UIModalPresentationStyle/custom) 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 don’t implement this method, or if your implementation of this method returns `nil`, the system uses a default presentation controller object. The default presentation controller doesn’t add any views or content to the view hierarchy.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)