我想分享一些内容。发送电子邮件或短信后,我的应用程序崩溃了。收到的电子邮件和短信。它适用于所有其他类型。 我添加了社交框架并将Social导入到该类
我的代码:
if let myWebsite = NSURL(string: "http://www.mstcode.com")
{
let messageStr = "Learn how to build iPhone apps"
let shareItems = [messageStr, myWebsite]
let activityController = UIActivityViewController(activityItems: shareItems, applicationActivities: nil)
if UIDevice.currentDevice().userInterfaceIdiom == .Pad {
activityController.popoverPresentationController?.sourceView = sender
}
self.presentViewController(activityController, animated: true,completion: nil)
}