A switch is a visual toggle between two mutually exclusive states — on and off. A switch shows that it's on when the accent color is visible and off when the switch appears colorless.
Use a switch in a view, not a window frame. Switches aren’t intended for use in window frame elements like toolbars and status bars.
Avoid using a switch to control a single detail or a minor setting. A switch has more visual weight than a checkbox, so it looks better when it controls more functionality than a checkbox typically does. For example, you might use a switch to let people turn on or off a group of settings.
In general, don't replace a checkbox with a switch. If you're already using a checkbox in your UI, it's probably best to keep using it. For guidance, see Checkboxes.
For developer guidance, see NSSwitch.