An abstract class that defines the interface for subclassers to interact with the screen saver infrastructure.


@interface ScreenSaverView : NSView


Screen savers are subclasses of ScreenSaverView, 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.) ScreenSaverView 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.

There are two main ways to do drawing in a screen saver. You can either do your drawing in the NSView method drawRect:, or you can do your drawing in the ScreenSaverView method animateOneFrame. If you do drawing in drawRect:, you should call setNeedsDisplayInRect: with an argument of YES in animateOneFrame.


Initializing a ScreenSaverView

- initWithFrame:isPreview:

Initializes a newly allocated ScreenSaverView with frame as its frame rectangle, and sets the value returned by preview to isPreview.

Getting the preferred window behavior

+ backingStoreType

Returns the desired backing store for windows in which the screen saver view will be instantiated.

+ performGammaFade

Indicates whether the screen saver application should perform a gradual screen fade when it starts and stops the animation.

Setting and getting the animation time interval


Sets the time interval between animation frames.

Animating the ScreenSaverView

- startAnimation

Activates the periodic timer that animates the screen saver.

- animateOneFrame

Advances the screen saver’s animation by a single frame.

- stopAnimation

Deactivates the timer that advances the animation.


A Boolean value that indicates if the screen saver is currently animating.

Drawing the ScreenSaverView

- drawRect:

Draws the screen saver view.


A Boolean value that indicates if the screen saver view was created in a size appropriate for use as a preview.

Accessing the configuration sheet


Returns whether the screen saver has an associated configuration sheet.


Returns the window containing all of the controls to be used for configuring the screen saver.


Inherits From