我创建并呈现带有有效URL的UIDocumentInteractionController
到保存的图像但是当我呈现控制器时“保存图像”不会出现。
NSURL *url = ...;
self.interactionController = [UIDocumentInteractionController interactionControllerWithURL:url];
[self.interactionController presentOptionsMenuFromBarButtonItem:sender animated:YES];
我已经验证self.interactionController.UTI
是有效的图像类型(jpeg)
注意*如果有人知道格式化这些图像的更好方法,请成为我的客人
为了能够选择保存到相机胶卷,应用程序必须具有访问照片的权限。
相对于ALAuthorizationStatus
([ALAssetsLibrary authorizationStatus]
)
显示“保存图像”
ALAuthorizationStatusAuthorized
ALAuthorizationStatusNotDetermined
“保存图像”未显示
ALAuthorizationStatusRestricted
ALAuthorizationStatusDenied
你可以像这样检查一下:
#import <AssetsLibrary/AssetsLibrary.h>
- (BOOL)canSaveToCameraRoll
{
ALAuthorizationStatus status = [ALAssetsLibrary authorizationStatus];
return (status == ALAuthorizationStatusAuthorized || status == ALAuthorizationStatusNotDetermined);
}