---
title: "requestViewController(completionHandler:)"
framework: audiotoolbox
role: symbol
role_heading: Instance Method
path: "audiotoolbox/auaudiounit/requestviewcontroller(completionhandler:)"
---

# requestViewController(completionHandler:)

Requests an audio unit’s custom view controller.

## Declaration

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

```swift
func requestViewController() async -> UIViewController?
```

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

```swift
func requestViewController() async -> NSViewController?
```

## Mentioned in

Migrating Your Audio Unit Host to the AUv3 API

## Discussion

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 AUViewController.
