我正在使用 UIDocumentInteractionController 发送一封带有 PDF 附件的电子邮件,如下所示:
我首先显示 PDF 文件
-(void)showPDFFile
{
NSURL *url = [NSURL fileURLWithPath:_filePath];
if (url) {
_documentInteractionController =
[UIDocumentInteractionController interactionControllerWithURL:url];
[_documentInteractionController setDelegate: self];
[_documentInteractionController presentPreviewAnimated:YES];
}
}
- (UIDocumentInteractionController *)setupControllerWithURL:(NSURL *)fileURL
usingDelegate:(id <UIDocumentInteractionControllerDelegate>)interactionDelegate {
UIDocumentInteractionController *interactionController =
[UIDocumentInteractionController interactionControllerWithURL: fileURL];
[interactionController setDelegate: interactionDelegate];
return interactionController;
}
当 PDF 文件显示出来时,用户点击“导出”选项,iOS 的“打开方式”视图就会出现。
现在单击电子邮件会打开一个准备发送电子邮件的视图控制器。
如何以编程方式设置收件人:抄送/密送和主题字段?
谢谢!