---
title: layer
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsview/layer
---

# layer

The Core Animation layer that the view uses as its backing store.

## Declaration

```swift
var layer: CALayer? { get set }
```

## Discussion

Discussion Use this property to set or get the layer associated with the view, if any. When set, the layer serves as the backing store for the view’s contents.

## See Also

### Managing the View’s Layer

- [wantsLayer](appkit/nsview/wantslayer.md)
- [wantsUpdateLayer](appkit/nsview/wantsupdatelayer.md)
- [makeBackingLayer()](appkit/nsview/makebackinglayer().md)
- [layerContentsPlacement](appkit/nsview/layercontentsplacement-swift.property.md)
- [NSView.LayerContentsPlacement](appkit/nsview/layercontentsplacement-swift.enum.md)
- [layerContentsRedrawPolicy](appkit/nsview/layercontentsredrawpolicy-swift.property.md)
- [NSView.LayerContentsRedrawPolicy](appkit/nsview/layercontentsredrawpolicy-swift.enum.md)
- [canDrawSubviewsIntoLayer](appkit/nsview/candrawsubviewsintolayer.md)
- [layerUsesCoreImageFilters](appkit/nsview/layerusescoreimagefilters.md)
- [NSViewLayerContentScaleDelegate](appkit/nsviewlayercontentscaledelegate.md)
