简体   繁体   English

如何像本地人一样从照片库中获取所有组?

[英]How to get all the groups from photo library, like native?

I Have create custom photo library like native and everything is working fine, But I am not able to get Videos,Favorites,Panoramas (group), How can I get this same as like native photo library ? 我已经创建了像本机照片库这样的自定义照片库,并且一切正常,但是我无法获得视频,收藏夹,全景图(组),如何像本机照片库一样获得此照片? I have use ALAssetsGroupAll to get groups from the library and show it in tableview like native. 我已经使用ALAssetsGroupAll从库中获取组,并像本机一样在tableview中显示它。 so please help me how to get Videos,Favorites,Panoramas (group)? 因此,请帮助我如何获取视频,收藏夹,全景图(组)?

Thanks in advance. 提前致谢。

You should enumerate all the groups available. 您应该列举所有可用的组。 ie something like this 即像这样的东西

ALAssetsLibraryGroupsEnumerationResultsBlock resultsBlock = ^(ALAssetsGroup *group, BOOL *stop)  {
    if (group){

    }
};

ALAssetsLibraryAccessFailureBlock failureBlock = ^(NSError *error){

};

NSUInteger type =
ALAssetsGroupLibrary | ALAssetsGroupAlbum | ALAssetsGroupEvent |
ALAssetsGroupFaces | ALAssetsGroupPhotoStream;
[self.assetsLibrary enumerateGroupsWithTypes:type
                                  usingBlock:resultsBlock
                                failureBlock:failureBlock];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM