I want to share some content. It my app crashes after I send email or sms. The emails and sms received. It works good with all other types. I added Social framework and imported Social to that class
My code:
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)
}
Aucun commentaire:
Enregistrer un commentaire