[英]iOS:How to listen to the change of photos and albums changes
Is there any way to listen to the change of ipad's photos and albums? 有没有办法听听ipad的照片和相册的变化? Something like
NSNotification
. 类似于
NSNotification
。 I used to use " ALAssetLibraryChangedNotification
" but i found it not appropriate for listening photo changes. 我曾经使用“
ALAssetLibraryChangedNotification
”,但发现它不适用于收听照片更改。
Any help? 有什么帮助吗? Thanks in advance!
提前致谢!
I don't think you can do this. 我认为您无法做到这一点。
The best way to do it is to look at the assets in appDidFinishLaunching
and then see the changes that you're interested in. 最好的方法是查看
appDidFinishLaunching
中的资产,然后查看您感兴趣的更改。
A few apps on the App Store do it this way. App Store上的一些应用程序就是这样做的。
You should use this in your appDelegate: registerChangeObserver:
The entire process is mentioned here: 您应该在appDelegate中使用它:
registerChangeObserver:
此处提到了整个过程:
https://developer.apple.com/library/ios/documentation/Photos/Reference/PHPhotoLibrary_Class/#//apple_ref/occ/instm/PHPhotoLibrary/registerChangeObserver: https://developer.apple.com/library/ios/documentation/Photos/Reference/PHPhotoLibrary_Class/#//apple_ref/occ/instm/PHPhotoLibrary/registerChangeObserver:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.