deactivate(options:completionHandler:)
Deactivates the audio session asynchronously.
Declaration
func deactivate(options: AVAudioSessionDeactivationOptions = [], completionHandler handler: @escaping @Sendable (Bool, (any Error)?) -> Void)func deactivate(options: AVAudioSessionDeactivationOptions = []) async throws -> BoolParameters
- options:
Deactivation options.
- handler:
A completion handler called with a success flag and an error if deactivation failed.
Discussion
This method returns immediately without blocking the calling thread. The system calls the completion handler with the result.