ios - iPhone : Photos framework : how to get only those album/images which created by my app only not by others?

标签 ios iphone camera photosframework

我正在创建一个类似照片应用程序的应用程序。我的应用程序创建相册并捕获图像并将它们保存在照片应用程序的相册中。为此,我正在使用照片框架。当我获取相册时,它会为我提供由我的应用程序以及其他应用程序创建的相册。所以我只想要那些由我的应用程序创建的相册/图像,而不是由其他应用程序创建的。

最佳答案

没有直接的方法可以做到这一点。但这是一种解决方法。

PHFetchResult *topLevelUserCollections = [PHCollectionList fetchTopLevelUserCollectionsWithOptions:nil];
    self.collectionsFetchResults = @[topLevelUserCollections];

    for (PHFetchResult *fetchResult in self.collectionsFetchResults) {
            for (PHAssetCollection *assetCollection in fetchResult) {
                BOOL shouldShowCollection = NO;
                if ([assetCollection.localizedTitle isEqualToString:@"YOUR_APP_NAME"]) {
                    shouldShowCollection = YES;
                }

                if (shouldShowCollection) {
                   //collectionsToShow are the collections that you will show up in your table view
                   [self.collectionsToShow addObject:assetCollection];
                }
            }
        }

关于ios - iPhone : Photos framework : how to get only those album/images which created by my app only not by others?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28987198/

相关文章:

iphone - 将文件从包复制到文档路径时显示进度条

iphone - 将应用内视频保存到相机胶卷?

ios - 圆形导航栏图像 iphone sdk

ios - 快速准备 segue 不工作

iphone - 拒绝后提交 iOS 二进制文件

ios - 在ios中将json转换成字典

c++ - 计算第三人称摄像机的位置

iPhone - 如何创建自定义相册并以编程方式为相机胶卷中的照片指定自定义名称?

objective-c - 永远不会调用UIImage dealloc

ios - 提高 OpenGL ES 2.0 和 GPUImage 的精度