UIDocumentInteractionController 有效但不显示 "Save Image"

UIDocumentInteractionController works but doesn't show "Save Image"

我创建了一个 UIDocumentInteractionController 并向保存的图像展示了一个有效的 url,但是当我展示控制器时 "Save Image" 没有出现。

NSURL *url = ...;
self.interactionController = [UIDocumentInteractionController interactionControllerWithURL:url];
[self.interactionController presentOptionsMenuFromBarButtonItem:sender animated:YES];

我已验证 self.interactionController.UTI 是有效的图像类型 (jpeg)

______Actual_______ vs.____Expected_____

____

注意* 如果有人知道格式化这些图像的更好方法,请成为我的客人

为了可以选择保存到相机胶卷,应用程序必须有权访问照片。

相对于 ALAuthorizationStatus ([ALAssetsLibrary authorizationStatus])

"Save Image" 显示

  1. ALAuthorizationStatusAuthorized
  2. ALAuthorizationStatusNotDetermined

"Save Image" 未显示

  1. ALAuthorizationStatusRestricted
  2. ALAuthorizationStatusDenied

您可以这样检查:

#import <AssetsLibrary/AssetsLibrary.h>

- (BOOL)canSaveToCameraRoll
{
    ALAuthorizationStatus status = [ALAssetsLibrary authorizationStatus];
    return (status == ALAuthorizationStatusAuthorized || status == ALAuthorizationStatusNotDetermined);
}