Instance Method

components(passingTest:)

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. The block can set the value to true to stop further processing of the search. The stop argument is an out-only argument. You should only ever set this Boolean to true within the Block.

The block returns a Boolean value that indicates whether comp passed the test. Returning true will stop further processing of the audio components.

Return Value

An array of audio components that pass the test.

Discussion

For each AudioComponent found by the manager, the block method will be called. If the block returns YES then the AVAudioComponent instance is added to the array.

See Also

Getting Matching Audio Components

func components(matching: AudioComponentDescription) -> [AVAudioUnitComponent]

An array of audio component objects that matches the description.

func components(matching: NSPredicate) -> [AVAudioUnitComponent]

An array of audio component objects that matches the search predicate.