An abstract class that defines the interface for subclassers to interact with the screen saver infrastructure.
SDK
- macOS 10.0+
Framework
- Screen
Saver
Declaration
class ScreenSaverView : NSView
Overview
Screen savers are subclasses of Screen
, packaged up in bundles and loaded by the screen saver application. (These bundles have a suffix of .saver
and are located in the Library/Screen Savers
directories of the various file system domains. See File System Overview for information about domains.) Screen
defines an interface for animating screen savers, instantiating small preview versions of the screen saver view (for display in System Preferences, for example), and for providing a configuration sheet to set various properties of the screen saver. In addition, subclasses can set the animation interval, the backing store of their window, and how the screen transitions to the animation.
Note
When a user clicks Preview in Screen Saver System Preferences, your Screen
subclass is instantiated.
There are two main ways to do drawing in a screen saver. You can either do your drawing in the NSView
method draw(_:)
, or you can do your drawing in the Screen
method animate
. If you do drawing in draw(_:)
, you should call set
with an argument of true
in animate
.