init(named:)
Creates a sound object that represents a custom sound file.
Declaration
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:
The <app_container>
/Library/Soundsdirectory, where <app_container> is the app’s container directory.The <group_container>
/Library/Soundsdirectory, 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.The main bundle of the current executable.
The method chooses the first file it finds with the specified name.