---
title: contentView
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsbox/contentview
---

# contentView

The receiver’s content view.

## Declaration

```swift
var contentView: NSView? { get set }
```

## Discussion

Discussion The content view of the NSBox object. The content view is created automatically when the box is created and resized as the box is resized (you should never send frame-altering messages directly to a box’s content view). You can replace it with an NSView of your own.

## See Also

### Managing Content

- [contentViewMargins](appkit/nsbox/contentviewmargins.md)
