Instance Property

completionHandler

A closure that the playback controller executes when it comes to the end of the audio stream.

Declaration

var completionHandler: (() -> Void)?

Discussion

The controller doesn’t call the closure if you manually stop the audio by calling the stop() or the pause() method.

You can only register one handler at a time. If you set a new handler, the controller discards the old one.