Instance Method


Registers an external audio file for use as a custom waveform.


func registerAudioResource(_ resourceURL: URL, options: [AnyHashable : Any] = [:]) throws -> CHHapticAudioResourceID



The ID of the audio resource you'd like to register.


An error that contains information about failed resource registration, or nil if no error occurred.


Before you initialize a Core Haptics event with your own audio file, use this method to register that file. External audio files are referenced via URL.

Input the value that this method returns when creating the dictionary or event representation of a haptic pattern.

See Also

Registering Audio Resources

func unregisterAudioResource(CHHapticAudioResourceID)

Unregisters a previously registered external audio file.

typealias CHHapticAudioResourceID

A type alias used to register an ID for a custom audio resource.