IOS 8 Swift Audio Playback Execute method on completion

I am playing an audio file in Swift for iOS 8. I need to know when the audio is finished. How can I execute the method when the sound is finished?


source to share

1 answer

It depends on how you play. Find a delegate method, notification, or observable property whose state change can trigger a KVO notification.

For example, if you are using AVAudioPlayer, it delegate

is notified by the delegate method, which you can check here: / uid / TP40008068



All Articles