2

I would like to know if it is possible to observe Media Library changes in iOS.

I would like to be notified every time a user adds, remove or edit a Media Item (Song, Artist or Album item).

I have still not found a way to do that.

Augusto Carmo
  • 4,386
  • 2
  • 28
  • 61

1 Answers1

3

You can use notification MPMediaLibraryDidChange to observe the library changes. Be sure to call beginGeneratingLibraryChangeNotifications() first.

For reference https://developer.apple.com/documentation/mediaplayer/mpmedialibrary

Rossine
  • 46
  • 1
  • 1
    Thank you very much for your reply \o/ Reading that doc I realized that, for my case, I could use the `lastModifiedDate` variable instead of "observing" for changes :D – Augusto Carmo Jul 18 '18 at 16:10