When using notification center, how do you determine that the song has ended?
NSNotificationCenter.defaultCenter().addObserver(self,
selector:#selector(updateNowPlayingInfo),
name: MPMusicPlayerControllerPlaybackStateDidChangeNotification,
object: musicPlayer)
The nowPlayingItem should change when song has finished playing. In conjunction with the playback state, that should be enough to determine if the song has finished playing to the end.