<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioUnitComponentManager/components(passingTest:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioUnitComponentManager(im)componentsPassingTest:"
  },
  "title" : "components(passingTest:)"
}
-->

# components(passingTest:)

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

```
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 <doc://com.apple.documentation/documentation/Swift/true>. The stop argument is an out-only argument. Only set this Boolean to <doc://com.apple.documentation/documentation/Swift/true> within the block.

    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

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 <doc://com.apple.documentation/documentation/Swift/true>, the method adds `AVAudioComponent` instance to the array.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)