---
title: navigationController
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uiviewcontroller/navigationcontroller
---

# navigationController

The nearest ancestor in the view controller hierarchy that is a navigation controller.

## Declaration

```swift
var navigationController: UINavigationController? { get }
```

## Discussion

Discussion If the view controller or one of its ancestors is a child of a navigation controller, this property contains the owning navigation controller. This property is nil if the view controller is not embedded inside a navigation controller.

## See Also

### Getting other related view controllers

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