Instance Property


The window’s content view, the highest accessible NSView object in the window’s view hierarchy.


var contentView: NSView? { get set }


The window retains the new content view and owns it thereafter. The view object is resized to fit precisely within the content area of the window. You can modify the content view’s coordinate system through its bounds rectangle, but can’t alter its frame rectangle (that is, its size or location) directly.

Setting this property causes the old content view to be released; if you plan to reuse it, be sure to retain it before changing the property value and to release it as appropriate when adding it to another NSWindow or NSView object.

See Also

Configuring the Window's Content

var contentViewController: NSViewController?

The main content view controller for the window.