小编Gar*_*ava的帖子

如何使用Photos API在iOS 8.0中检索照片扩展(jpg/png)?

我试图在iOS 8中使用新的Photos API获取照片的文件扩展名,但直到现在还没有找到方法.在iOS 8.0之前,我会使用ALAssetRepresentation来获取文件扩展名,如:

// Get asset representation from asset
ALAssetRepresentation *assetRepresentation = [asset defaultRepresentation];

// Extract file extension from the original file name
NSString* fileExt = [[assetRepresentation filename] pathExtension];
Run Code Online (Sandbox Code Playgroud)

现在有什么方法可以获得照片的文件扩展名吗?PS:我正在使用新的Photos API,因为我需要访问我的照片应用中的所有照片,而ALassetsLibrary只能访问"最近添加"的照片.

photos ios8 photosframework

4
推荐指数
1
解决办法
6034
查看次数

标签 统计

ios8 ×1

photos ×1

photosframework ×1