我想与whatsapp共享一个.m4a
文件,但我不明白我该怎么做?
这是我的代码。
var controller = UIDocumentInteractionController()
if UIApplication.sharedApplication().canOpenURL(NSURL(string:"whatsapp://app")!) {
var savePath = NSBundle.mainBundle().pathForResource("test", ofType:"m4a")
controller = UIDocumentInteractionController(URL:NSURL(fileURLWithPath:savePath!)!)
controller.UTI = "net.whatsapp.audio"
controller.presentOpenInMenuFromRect(CGRectZero, inView: self.view, animated: true)
}
else {
println("error")
}