<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UserNotifications",
  "identifier" : "/documentation/UserNotifications/UNMutableNotificationContent",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "User Notifications"
    ],
    "preciseIdentifier" : "c:objc(cs)UNMutableNotificationContent"
  },
  "title" : "UNMutableNotificationContent"
}
-->

# UNMutableNotificationContent

The editable content for a notification.

```
class UNMutableNotificationContent
```

## Overview

Create a [`UNMutableNotificationContent`](/documentation/UserNotifications/UNMutableNotificationContent) object when you want to specify the payload for a local notification. Specifically, use this object to specify the title and message for an alert, the sound to play, or the value to assign to your app’s badge. You might also provide details about how the system handles the notification. For example, you can specify a custom launch image and a thread identifier for visually grouping related notifications.

After creating your content object, assign it to a [`UNNotificationRequest`](/documentation/UserNotifications/UNNotificationRequest) object, add a trigger condition, and schedule your notification. The trigger condition defines when the system delivers the notification to the user. Listing 1 shows the scheduling of a local notification that displays an alert and plays a sound after a delay of five seconds. Store the strings for the alert’s title and body in the app’s `Localizable.strings` file.

Listing 1. Creating the content for a local notification

```swift
// Configure the notification's payload.
let content = UNMutableNotificationContent()
content.title = NSString.localizedUserNotificationString(forKey: "Hello!", arguments: nil)
content.body = NSString.localizedUserNotificationString(forKey: "Hello_message_body", arguments: nil)
content.sound = UNNotificationSound.default
 
// Deliver the notification in five seconds.
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 5, repeats: false)
let request = UNNotificationRequest(identifier: "FiveSecond", content: content, trigger: trigger) // Schedule the notification.
let center = UNUserNotificationCenter.current()
center.add(request) { (error : Error?) in
     if let theError = error {
         // Handle any errors
     }
}
```

> Note:
> Local notifications always result in user interactions, and the system ignores any interactions for which your app isn’t authorized. For information about how to request authorization for user interactions, see <doc://com.apple.usernotifications/documentation/UserNotifications/asking-permission-to-use-notifications>.

### Localizing the Alert Strings

Localize the strings you display in a notification alert for the current user. Although you can use the <doc://com.apple.documentation/documentation/Foundation/NSLocalizedString> macros to load strings from your app’s resource files, a better option is to specify your string using the <doc://com.apple.documentation/documentation/Foundation/NSString/localizedUserNotificationString(forKey:arguments:)> method of <doc://com.apple.documentation/documentation/Foundation/NSString>. The <doc://com.apple.documentation/documentation/Foundation/NSString/localizedUserNotificationString(forKey:arguments:)> method delays the loading of the localized string until the system delivers the notification. If the user changes the language setting before the system delivers a notification, the system updates the alert text to the user’s current language instead of the language in use when the system scheduled the notification.

## Topics

### Providing the primary content

[`title`](/documentation/UserNotifications/UNMutableNotificationContent/title)

The localized text that provides the notification’s primary description.

[`subtitle`](/documentation/UserNotifications/UNMutableNotificationContent/subtitle)

The localized text that provides the notification’s secondary description.

[`body`](/documentation/UserNotifications/UNMutableNotificationContent/body)

The localized text that provides the notification’s main content.

### Providing supplementary content

[`attachments`](/documentation/UserNotifications/UNMutableNotificationContent/attachments)

The visual and audio attachments to display alongside the notification’s main content.

[`userInfo`](/documentation/UserNotifications/UNMutableNotificationContent/userInfo)

The custom data to associate with the notification.

### Configuring app behavior

[`launchImageName`](/documentation/UserNotifications/UNMutableNotificationContent/launchImageName)

The name of the image or storyboard to use when your app launches because of the notification.

[`badge`](/documentation/UserNotifications/UNMutableNotificationContent/badge)

The number that your app’s icon displays.

[`targetContentIdentifier`](/documentation/UserNotifications/UNMutableNotificationContent/targetContentIdentifier)

The value your app uses to determine which scene to display to handle the notification.

### Integrating with the system

[`sound`](/documentation/UserNotifications/UNMutableNotificationContent/sound)

The sound that plays when the system delivers the notification.

[`interruptionLevel`](/documentation/UserNotifications/UNMutableNotificationContent/interruptionLevel)

The notification’s importance and required delivery timing.

[`UNNotificationInterruptionLevel`](/documentation/UserNotifications/UNNotificationInterruptionLevel)

Constants that indicate the importance and delivery timing of a notification.

[`relevanceScore`](/documentation/UserNotifications/UNMutableNotificationContent/relevanceScore)

The score the system uses to determine if the notification is the summary’s featured notification.

[`filterCriteria`](/documentation/UserNotifications/UNMutableNotificationContent/filterCriteria)

The criteria the system evaluates to determine if it displays the notification in the current Focus.

### Grouping notifications

[`threadIdentifier`](/documentation/UserNotifications/UNMutableNotificationContent/threadIdentifier)

The identifier that groups related notifications.

[`categoryIdentifier`](/documentation/UserNotifications/UNMutableNotificationContent/categoryIdentifier)

The identifier of the notification’s category.

[`summaryArgument`](/documentation/UserNotifications/UNMutableNotificationContent/summaryArgument)

The text the system adds to the notification summary to provide additional context.

[`summaryArgumentCount`](/documentation/UserNotifications/UNMutableNotificationContent/summaryArgumentCount)

The number the system adds to the notification summary when the notification represents multiple items.



---

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)