func sendVideo(videoName: String, senderView: UIView) {
let path = NSBundle.mainBundle().pathForResource(videoName, ofType:"m4v")!
let fileUrl = NSURL(fileURLWithPath: path)!
docController = UIDocumentInteractionController(URL: fileUrl)
docController.UTI = "net.whatsapp.movie"
docController.presentOpenInMenuFromRect(CGRectZero, inView: senderView, animated: true)
}
Here is the Swift version:
func sendVideo(videoName: String, senderView: UIView) {
let path = NSBundle.mainBundle().pathForResource(videoName, ofType:"m4v")!
let fileUrl = NSURL(fileURLWithPath: path)!
docController = UIDocumentInteractionController(URL: fileUrl)
docController.UTI = "net.whatsapp.movie"
docController.presentOpenInMenuFromRect(CGRectZero, inView: senderView, animated: true)
}