Contents

components(passingTest:)

Gets an array of audio components that pass the block method.

Declaration

func components(passingTest testHandler: @escaping (AVAudioUnitComponent, UnsafeMutablePointer<ObjCBool>) -> Bool) -> [AVAudioUnitComponent]

Parameters

  • testHandler:

    The block to apply to the audio unit components.

    The block takes two parameters.

    comp

    A block to test.

    stop

    A reference to a Boolean value. To stop further processing of the search, the block sets the value to True. The stop argument is an out-only argument. Only set this Boolean to True within the block.

    The block returns a Boolean value that indicates whether comp passes the test. Returning True stops further processing of the audio components.

Return Value

An array of audio components that pass the test.

Discussion

For each audio component the manager finds, the system calls the block method. If the block returns true, the method adds AVAudioComponent instance to the array.

See Also

Getting matching audio components