<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.14.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UserNotifications",
  "identifier" : "/documentation/UserNotifications/UNNotificationSound/init(named:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "User Notifications"
    ],
    "preciseIdentifier" : "c:objc(cs)UNNotificationSound(cm)soundNamed:"
  },
  "title" : "init(named:)"
}
-->

# init(named:)

Creates a sound object that represents a custom sound file.

```
convenience init(named name: UNNotificationSoundName)
```

## Parameters

`name`

The name of the sound file to play. This parameter must not be `nil`.

## Return Value

A sound object representing the custom sound.

## Discussion

This method searches for sound files in the following locations, in order:

1. The *<app_container>*`/Library/Sounds` directory, where *<app_container>* is the app’s container directory.
2. The *<group_container>*`/Library/Sounds` directory, where *<group_container>* is one of the app’s shared group container directories. For information about how to configure group containers for your app, see [Configure app groups](https://help.apple.com/xcode/mac/current/#/dev8dd3880fe).
3. The main bundle of the current executable.

The method chooses the first file it finds with the specified name.

---

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)