I'm not sure if this strategy follows HIG, it is often more often found to do something like displaying a constant character indicating that the field is not checked next to the field, but it should not be too difficult to get the effect you are looking for.
It might be easier to use a simple NSAnimation instead of using Core Animation. The standard code for drawing a focus ring usually looks like this:
[NSGraphicsContext saveGraphicsState]; NSSetFocusRingStyle(NSFocusRingOnly); [[NSColor clearColor] set]; [[NSBezierPath bezierPathWithRect:focusRect] fill]; [NSGraphicsContext restoreGraphicsState];
This code will be implemented in the drawRect: method in a custom subclass of your control.
To draw an individual color focus ring, you need to draw a rectangle yourself and will not be able to use the NSSetFocusRingStyle function. The color will be disconnected from NSAnimation, which will also cause the control to repaint itself. Since you are not using Cocoa objects to draw the focus ring, you also probably need to insert the contents of your view so that you have space to draw the ring.
More information on NSAnimations is available in Cocoa Animation Programming Guide.
source share