<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioToolbox",
  "identifier" : "/documentation/AudioToolbox/AUAudioUnit/requestViewController(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Audio Toolbox",
      "AudioToolbox"
    ],
    "preciseIdentifier" : "c:objc(cs)AUAudioUnit(im)requestViewControllerWithCompletionHandler:"
  },
  "title" : "requestViewController(completionHandler:)"
}
-->

# requestViewController(completionHandler:)

Requests an audio unit’s custom view controller.

```
func requestViewController(completionHandler: @escaping @Sendable (NSViewController?) -> Void)
```

## Discussion

The completion handler is called on a thread or dispatch queue internal to the audio unit’s implementation. If the audio unit does not implement a custom view controller, it returns `nil`. If it has a custom view controller, it instantiates the view controller and returns it. The custom view controller must be a subclass of <doc://com.apple.documentation/documentation/CoreAudioKit/AUViewController>.

---

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)