<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ScreenSaver",
  "identifier" : "/documentation/ScreenSaver/ScreenSaverView",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Screen Saver"
    ],
    "preciseIdentifier" : "c:objc(cs)ScreenSaverView"
  },
  "title" : "ScreenSaverView"
}
-->

# ScreenSaverView

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

```
class ScreenSaverView
```

## Overview

[`ScreenSaverView`](/documentation/ScreenSaver/ScreenSaverView) provides the interface for your screen saver, including the content you animate onscreen and an optional configuration sheet. Create your own custom subclass and add it to your screen saver bundle. Use your subclass to create the animations that you want to appear onscreen, and to specify additional animation details.

> Note:
> When someone previews your screen saver in System Preferences, the system instantiates your ``doc://com.apple.screensaver/documentation/ScreenSaver/ScreenSaverView`` subclass.

You can draw from your view’s [`draw(_:)`](/documentation/ScreenSaver/ScreenSaverView/draw(_:)) method, or you can draw directly from the [`animateOneFrame()`](/documentation/ScreenSaver/ScreenSaverView/animateOneFrame()) method. If you prefer to use the [`draw(_:)`](/documentation/ScreenSaver/ScreenSaverView/draw(_:)) method, use the [`animateOneFrame()`](/documentation/ScreenSaver/ScreenSaverView/animateOneFrame()) method to call the <doc://com.apple.documentation/documentation/AppKit/NSView/setNeedsDisplay(_:)> method and specify the portions of your view that require updates.

## Topics

### Creating a screen saver view

[`-  initWithFrame:isPreview:`](/documentation/ScreenSaver/ScreenSaverView/init(frame:isPreview:))

Creates a newly allocated screen saver view with the specified frame rectangle and preview information.

### Getting the preferred window behavior

[`+  backingStoreType`](/documentation/ScreenSaver/ScreenSaverView/backingStoreType())

Returns the type of backing store you want for your screen saver’s window.

[`+  performGammaFade`](/documentation/ScreenSaver/ScreenSaverView/performGammaFade())

Indicates whether to perform a gradual screen fade when the system starts and stops your screen saver’s animation.

### Setting and getting the animation time interval

[`animationTimeInterval`](/documentation/ScreenSaver/ScreenSaverView/animationTimeInterval)

The time interval between animation frames.

### Animating the screen saver

[`-  startAnimation`](/documentation/ScreenSaver/ScreenSaverView/startAnimation())

Activates the periodic timer that animates the screen saver.

[`-  animateOneFrame`](/documentation/ScreenSaver/ScreenSaverView/animateOneFrame())

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

[`-  stopAnimation`](/documentation/ScreenSaver/ScreenSaverView/stopAnimation())

Deactivates the timer that advances the animation.

[`animating`](/documentation/ScreenSaver/ScreenSaverView/isAnimating)

A Boolean value that indicates whether the screen saver is animating.

### Drawing the view

[`-  drawRect:`](/documentation/ScreenSaver/ScreenSaverView/draw(_:))

Draws the screen saver view.

[`preview`](/documentation/ScreenSaver/ScreenSaverView/isPreview)

A Boolean value that indicates whether the screen saver view is set to a size suitable for previewing its content.

### Accessing the configuration sheet

[`hasConfigureSheet`](/documentation/ScreenSaver/ScreenSaverView/hasConfigureSheet)

A Boolean value that indicates whether the screen saver has an associated configuration sheet.

[`configureSheet`](/documentation/ScreenSaver/ScreenSaverView/configureSheet)

The window that contains the controls to configure the screen saver.

## Relationships

### Conforms To

[`NSUserInterfaceItemIdentification`](/documentation/AppKit/NSUserInterfaceItemIdentification)

[`NSUserActivityRestoring`](/documentation/AppKit/NSUserActivityRestoring)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSStandardKeyBindingResponding`](/documentation/AppKit/NSStandardKeyBindingResponding)

[`NSAccessibilityElementProtocol`](/documentation/AppKit/NSAccessibilityElementProtocol)

[`NSAppearanceCustomization`](/documentation/AppKit/NSAppearanceCustomization)

[`Hashable`](/documentation/Swift/Hashable)

[`NSDraggingDestination`](/documentation/AppKit/NSDraggingDestination)

[`Equatable`](/documentation/Swift/Equatable)

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

[`NSAccessibilityProtocol`](/documentation/AppKit/NSAccessibilityProtocol)

[`NSAnimatablePropertyContainer`](/documentation/AppKit/NSAnimatablePropertyContainer)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

### Inherits From

[`NSView`](/documentation/AppKit/NSView)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)