Initializer

init(audioSource:relativeAudioSourceReference:)

Initializes the intent object with the specified audio source information.

Declaration

init(audioSource: INCarAudioSource, relativeAudioSourceReference: INRelativeReference)

Parameters

audioSource

The specific audio source to select. If you want to specify the next or previous audio source instead of a specific audio source, specify INCarAudioSource.sourceUnknown for this parameter and specify an appropriate value in the relativeAudioSourceReference parameter.

relativeAudioSourceReference

The relative audio source to select. If you want to select a specific audio source instead, specify INRelativeReference.unknown for this parameter and specify an appropriate value in the audioSource parameter.

Return Value

An initialized intent object or nil if the object could not be created.

Discussion

Normally, you do not create instances of this class yourself. Instead, Siri creates instances when the user asks to change the vehicle’s audio source. However, you can use this method during testing to create intent objects in order to validate your intent handling code paths. Your test code should always specify the unknown constant for one of the parameters; do not specify the unknown constant for both parameters.