2019
It's really this simple
NotificationCenter.default.addObserver(
self,
selector: #selector(fileComplete),
name: NSNotification.Name.AVPlayerItemDidPlayToEndTime,
object: nil)
(It's fine for the object to be nil.)
and then
@objc func fileComplete() {
print("IT'S DONE!")
}