---
title: ScreenSaverDefaults
framework: Screen Saver
role: symbol
role_heading: Class
platforms: [macOS 10.0+]
path: screensaver/screensaverdefaults
---

# ScreenSaverDefaults

A class that defines a set of methods for saving and restoring user defaults for screen savers.

## Declaration

```swift
class ScreenSaverDefaults
```

## Overview

Overview ScreenSaverDefaults gives you access to preference values you need to configure your screen saver. Because multiple apps can load a screen saver, you can’t use the standard UserDefaults object to store preferences. Instead, instantiate this class using the init(forModuleWithName:) method, which takes your screen saver’s bundle identifier as a parameter. The resulting object gives you a way to store your preference values and associate them only with your screen saver. Use the inherited UserDefaults methods to load, store, or modify values.

## Topics

### Creating the screen saver defaults

- [init(forModuleWithName:)](screensaver/screensaverdefaults/init(formodulewithname:).md)

## Relationships

### Inherits From

- [UserDefaults](foundation/userdefaults.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Interface

- [ScreenSaverView](screensaver/screensaverview.md)
