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 Sourceunknown for this parameter and specify an appropriate value in the
relativeAudioSourceReferenceparameter. - relativeAudioSourceReference:
The relative audio source to select. If you want to select a specific audio source instead, specify Unknown for this parameter and specify an appropriate value in the
audioSourceparameter.
Return Value
An initialized intent object or nil if the object could not be created.
Discussion
Normally, you don’t 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; don’t specify the unknown constant for both parameters.