---
title: parent
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsviewcontroller/parent
---

# parent

The immediate ancestor view controller of the view controller.

## Declaration

```swift
var parent: NSViewController? { get }
```

## Discussion

Discussion The value of this property is nil if the view controller has no parent view controller, such as if the view controller is a window’s content view controller.

## See Also

### Getting Related View Controllers

- [presentedViewControllers](appkit/nsviewcontroller/presentedviewcontrollers.md)
- [presentingViewController](appkit/nsviewcontroller/presentingviewcontroller.md)
