Instance Method

requestViewController(completionHandler:)

Requests an audio unit's custom view controller.

Declaration

iOS, Mac Catalyst
func requestViewController(completionHandler: @escaping (UIViewController?) -> Void)
macOS
func requestViewController(completionHandler: @escaping (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 AUViewController.

See Also

Required Methods

func createAudioUnit(with: AudioComponentDescription) -> AUAudioUnit

Creates an instance of an extension’s audio unit.

Required.