나는 어디에서나 찾고 있었지만 이에 대한 답을 찾을 수 없었습니다.IOS 사진 라이브러리 주어진 사진의 앨범 이름을 가져옵니다.
IOS PhotosFramework에서 이미지/PHAsset을 가져 와서 할당 된 모든 컬렉션/앨범을 어떻게 찾을 수 있습니까?
이미 모든 앨범 목록을 가져 오는 방법을 알고 있습니다. 각 앨범의 모든 이미지를 가져올 수도 있습니다. 그렇지만 내가 주어진 방식으로, 즉 지정된 PHAsset에 할당 된 앨범/컬렉션의 이름을 얻는 방법은 다른 방법과 어떻게 다른가요? 여기
내가 카메라 롤에있는 모든 앨범의 목록을 얻을 수있는 코드입니다 :-(void) listAllAlbums{
PHFetchOptions *userAlbumsOptions = [PHFetchOptions new];
userAlbumsOptions.predicate = [NSPredicate predicateWithFormat:@"estimatedAssetCount > 0"];
PHFetchResult *userAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAny options:userAlbumsOptions];
NSLog(@"--------- entered %s ------------- ", __PRETTY_FUNCTION__);
[userAlbums enumerateObjectsUsingBlock:^(PHAssetCollection *collection, NSUInteger idx, BOOL *stop) {
NSLog(@"album title %@", collection.localizedTitle);
}];
NSLog(@"--------- end of %s ------------- ", __PRETTY_FUNCTION__);
}
감사
감사 Rickster을! 이것은 내가 필요한 것입니다. 당신의 도움을 주셔서 감사합니다. – Pankaj