0
我只是試圖訪問位於名爲「MyFolder」的自定義文件夾中的照片到我的UICollectionView。我可以很容易地得到這個與下面的代碼「所有照片和視頻」的工作,但我無法弄清楚如何篩選結果只包括我的文件夾名稱:使用此PHFetchResult僅限自定義相冊
PHFetchOptions *allPhotosOptions = [PHFetchOptions new];
allPhotosOptions.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:YES]];
PHFetchResult *videos = [PHAsset fetchAssetsWithMediaType:PHAssetMediaTypeVideo options:allPhotosOptions];
[videos enumerateObjectsUsingBlock:^(PHAsset *asset, NSUInteger idx, BOOL *stop) {
//add assets to array
}];
我曾嘗試:
allPhotosOptions.predicate = [NSPredicate predicateWithFormat:@"title = %@", @"Coached"];
但它不起作用。有人可以幫助我嗎?