Instance Method

audioPlayerDidFinishPlaying(_:successfully:)

Called when a sound has finished playing.

Declaration

optional func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, successfully flag: Bool)

Parameters

player

The audio player that finished playing.

flag

true on successful completion of playback; false if playback stopped because the system could not decode the audio data.

Discussion

This method is not called upon an audio interruption. Rather, an audio player is paused upon interruption—the sound has not finished playing.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software