我正在使用UIActivityViewController
向我的应用添加分享。一切都在iPhone上按预期工作,但在iPad上,点击“UIActivityViewController”的电子邮件图标后,邮件视图控制器出现,但电子邮件的正文未设置(使用text1
)和电子邮件viewController处于非活动状态,不允许用户输入收件人。
let text1 = "this is the body of the email"
self.finalizeDocument()
let controller = UIActivityViewController(activityItems: [text1], applicationActivities: nil)
controller.setValue("Siged document is attached", forKey: "subject")
if let ppc = controller.popoverPresentationController {
ppc.barButtonItem = self.shareButton!
}
self.presentViewController(controller, animated: true, completion: nil)
答案 0 :(得分:0)
撰写并发送您的信息
import MessageUI
class ViewController: UIViewController, MFMailComposeViewControllerDelegate{
func someAwesomeFunction(){
var subjectText = “ OMG a subject”
var bodtText = “ YOLO”
var picker = MFMailComposeViewController()
picker.mailComposeDelegate = self
picker.setSubject(subjectText)
picker.setMessageBody(bodtText, isHTML: true)
presentViewController(picker, animated: true, completion: nil)
}
答案 1 :(得分:0)
事实证明重启iPad可以解决问题。