Observe Media Library changes in iOS

295 views Asked by At

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.

1

There are 1 answers

1
Rossine On BEST ANSWER

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