<!--
{
  "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

[`init?(frame: NSRect, isPreview: Bool)`](/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

[`class func backingStoreType() -> NSWindow.BackingStoreType`](/documentation/ScreenSaver/ScreenSaverView/backingStoreType())

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

[`class func performGammaFade() -> Bool`](/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

[`var animationTimeInterval: TimeInterval`](/documentation/ScreenSaver/ScreenSaverView/animationTimeInterval)

The time interval between animation frames.

### Animating the screen saver

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

Activates the periodic timer that animates the screen saver.

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

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

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

Deactivates the timer that advances the animation.

[`var isAnimating: Bool`](/documentation/ScreenSaver/ScreenSaverView/isAnimating)

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

### Drawing the view

[`func draw(NSRect)`](/documentation/ScreenSaver/ScreenSaverView/draw(_:))

Draws the screen saver view.

[`var isPreview: Bool`](/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

[`var hasConfigureSheet: Bool`](/documentation/ScreenSaver/ScreenSaverView/hasConfigureSheet)

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

[`var configureSheet: NSWindow?`](/documentation/ScreenSaver/ScreenSaverView/configureSheet)

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

## Relationships

### Inherits From

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

### Conforms To

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

---

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)