我正在尝试使用 UIAcitivityViewController 电子邮件共享来共享相机胶卷图像。
以下是我的代码。
ALAssetRepresentation *rep = [asset defaultRepresentation];
CGImageRef iref = [rep fullScreenImage];
UIImage *largeimage = [UIImage imageWithCGImage:iref scale:[rep scale] orientation:UIImageOrientationUp];
NSData *imageData = UIImageJPEGRepresentation(largeimage, 1.0);
NSArray *activityItems;
if (largeimage != nil) {
activityItems = @[imageData];
}
UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
[self presentViewController:activityController animated:YES completion:nil];
我不知道如何设置附件图像文件名。有什么建议吗?