The type of focus ring drawn around the view.
- macOS 10.3+
enum constant identifying a type of focus ring. Possible values are listed in
Use this property to specify the type of focus ring to draw. For a list of possible values, see
To disable drawing of a view’s focus ring, set the value of this property to
NSFocus. You should only disable the default drawing of a view’s focus ring when you want the view to draw its own focus ring. For example, you might disable focus ring drawing when the view uses its background color to indicate focus or when the view does not have sufficient space to display a focus ring.
Changing the value in this property does not cause the view to draw the actual focus ring. You are responsible for drawing the focus ring in your view’s
draw(_:) method whenever your view is made the first responder.
To ensure the correct redrawing of focus rings, note that AppKit may automatically draw parts of a window in addition to those that are marked as needing display. For example, AppKit may redraw parts of the first responder view in an app's key window, if that view's
focus property is set to a value other than
NSFocus. If your view can become first responder, but doesn't draw a focus ring, set
NSFocus to prevent AppKit from unnecessarily redrawing the view’s focus ring.