---
title: "components(passingTest:)"
framework: avfaudio
role: symbol
role_heading: Instance Method
path: "avfaudio/avaudiounitcomponentmanager/components(passingtest:)"
---

# components(passingTest:)

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

## Declaration

```swift
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. The block returns a Boolean value that indicates whether comp passes the test. Returning doc://com.apple.documentation/documentation/Swift/true stops further processing of the audio components.

## Return Value

Return Value An array of audio components that pass the test.

## Discussion

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

- [components(matching:)](avfaudio/avaudiounitcomponentmanager/components(matching:)-9qt94.md)
- [components(matching:)](avfaudio/avaudiounitcomponentmanager/components(matching:)-96l2c.md)
