<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/UserDefaults/SizeLimitExceededMessage",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:So14NSUserDefaultsC10FoundationE24SizeLimitExceededMessageV"
  },
  "title" : "UserDefaults.SizeLimitExceededMessage"
}
-->

# UserDefaults.SizeLimitExceededMessage

A message the system sends when the size of the data in the defaults database exceeds the maximum.

```
struct SizeLimitExceededMessage
```

## Overview

In tvOS, the system posts this message as a warning when the size of your app’s defaults database reaches 512 kilobytes.
If your app continues to write to the defaults database, the system terminates your app when the database reaches or exceeds 1 megabyte in size.

The system doesn’t post size exceeded messages for platforms other than tvOS.
The system posts this message on your app’s main thread.

Observe this message with the identifier [`sizeLimitExceeded`](/documentation/Foundation/NotificationCenter/MessageIdentifier/sizeLimitExceeded), or specify its type directly to the `addObserver(of:for:using:)` method.
The [`Subject`](/documentation/Foundation/NotificationCenter/MainActorMessage/Subject) of this message type is [`UserDefaults`](/documentation/Foundation/UserDefaults).

This message interoperates with the notification [`sizeLimitExceededNotification`](/documentation/Foundation/UserDefaults/sizeLimitExceededNotification).
The system notifies observers of the message when the [`NotificationCenter`](/documentation/Foundation/NotificationCenter) posts the notification.
Similarly, the system notifies observers of the notification when it posts the message.

## Topics

### Creating a message

[`init()`](/documentation/Foundation/UserDefaults/SizeLimitExceededMessage/init())

Creates a message when the user defaults database of a tvOS app exceeds its maximum size.

## Relationships

### Conforms To

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

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

[`MainActorMessage`](/documentation/Foundation/NotificationCenter/MainActorMessage)

---

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)