我试图在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只能访问"最近添加"的照片.