---
title: viewController
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nscustomtouchbaritem/viewcontroller
---

# viewController

A view controller whose view is displayed in the bar to represent this item.

## Declaration

```swift
var viewController: NSViewController? { get set }
```

## Discussion

Discussion When set, the item’s view property returns the view controller’s view property. The property is automatically set to nil if you provide your own value for the view property.

## See Also

### Providing item content

- [view](appkit/nscustomtouchbaritem/view.md)
