The contents redraw policy for the view’s layer.
- macOS 10.6+
layer settings can have significant impacts on performance. If you do not need to redraw your view during each frame update cycle, or if you are willing to accept an approximation of the view’s intermediate appearance during potentially brief animations in exchange for an animation performance and smoothness benefit, you can change the value of this property to one of the modes that does not require constant redrawing. When you do so, you must also specify the desired layer content placement for the view. The content placement determines how the backing layer’s existing cached content image will be mapped into the layer as the layer is resized. It is analogous to, and underpinned by, the
contents property of the
For a view that has no associated layer, or that has been assigned a developer-provided layer (a layer-hosting view) using the
layer property, the default contents redraw policy is
NSView and the
layer property is set to
NSView. These policies tell AppKit not to replace the layer’s content and to provide the same content placement as the
For a layer-backed view—that is, a view for which AppKit created the layer—AppKit sets the contents redraw policy to
NSView by default. This policy forces the view’s content to be continually redrawn into the view’s backing layer during animated resizing of the view, which produces correct but not optimal performance results.