我在我的应用程序中捕获图像,以及如何使用WHATSAPP通过按共享按钮(如RETRICA中)来分享图像。但我没有找到任何正确的方法。我用UIDocumentInteraction但它没有工作。我如何在IOS8中使用WHATSAPP的共享扩展来共享它。通过whatsapp分享图像ios 8
我在使用UIDocumentInteractionController时遇到了这个异常。
'UIDocumentInteractionController:invalid scheme(null)。只支持文件方案。“
这是我的代码
let image = UIImage(named: "nature")
let path = NSHomeDirectory().stringByAppendingPathComponent("Documents/whatsAppTmp.wai")
UIImageJPEGRepresentation(image!, 100.0)?.writeToFile(path, atomically: true)
let documentInteractionController = UIDocumentInteractionController(URL: NSURL(string: path)!)
documentInteractionController.UTI = "net.whatsapp.image"
您是否尝试过使用UIActivityViewController? – MXV