Kjuly / ALAssetsLibrary-CustomPhotoAlbum

A nice ALAssetsLibrary category for saving images & videos into custom photo album.
http://www.touch-code-magazine.com/ios5-saving-photos-in-custom-photo-album-category-for-download/
MIT License
405 stars 101 forks source link

ALAssetsLibraryChangedNotification #7

Closed rgksugan closed 9 years ago

rgksugan commented 11 years ago

Is is possible to get a notification if the files in a particular album are changed.

Kjuly commented 11 years ago

Good question! I think this feature will be useful. I'll research on it. :)

Kjuly commented 9 years ago

Hi @rgksugan , u can add observer with notification name: ALAssetsLibraryChangedNotification, and the userInfo offers

You can get the updated items & groups with NSURL items in NSSet instance.

DOC:

This notification will be sent when the contents of the ALAssetsLibrary have changed from under the app that is using the data. The API user should retain the library object to receive this notification. The userInfo may include the keys listed below, which identify specific ALAssets or ALAssetGroups that have become invalid and should be discarded. The values are NSSets of NSURLs which match the ALAssetPropertyURL and ALAssetsGroupPropertyURL properties. If the userInfo is nil, all ALAssets and ALAssetGroups should be considered invalid and discarded. Modified ALAssets will be identified by the ALAssetLibraryUpdatedAssetsKey, but inserted or deleted ALAssets are identified by invalidating the containing ALAssetGroups.