---
title: presentingViewController
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uiviewcontroller/presentingviewcontroller
---

# presentingViewController

The view controller that presented this view controller.

## Declaration

```swift
var presentingViewController: UIViewController? { get }
```

## Discussion

Discussion When you present a view controller modally (either explicitly or implicitly) using the present(_:animated:completion:) method, the view controller that was presented has this property set to the view controller that presented it. If the view controller was not presented modally, but one of its ancestors was, this property contains the view controller that presented the ancestor. If neither the current view controller or any of its ancestors were presented modally, the value in this property is nil.

## See Also

### Getting other related view controllers

- [presentedViewController](uikit/uiviewcontroller/presentedviewcontroller.md)
- [parent](uikit/uiviewcontroller/parent.md)
- [splitViewController](uikit/uiviewcontroller/splitviewcontroller.md)
- [navigationController](uikit/uiviewcontroller/navigationcontroller.md)
- [tabBarController](uikit/uiviewcontroller/tabbarcontroller.md)
