监听系统相册变化

1.监听系统相册的变化,

[[PHPhotoLibrary sharedPhotoLibrary] registerChangeObserver:self];

//系统方法回调

- (void)photoLibraryDidChange:(PHChange *)changeInstance{

  PHFetchResultChangeDetails *collectionChanges = [changeInstance changeDetailsForFetchResult:fetchRet];

if (collectionChanges) {

//相册内的元素变化,如相片的增减

}else{

//相册的增删,如用户自定义的相册

}

}

你可能感兴趣的:(监听系统相册变化)