I have this code that is called from within a UIAlertController:
func createSomeFile() {
var output = (some NSData to output to file)
let fileName = NSTemporaryDirectory().stringByAppendingPathComponent("filename.ext")
let url: NSURL! = NSURL(fileURLWithPath: fileName)
var dataToWrite = output.dataUsingEncoding(NSUTF8StringEncoding)
dataToWrite?.writeToFile(url.absoluteString!, atomically: true)
documentController = UIDocumentInteractionController(URL: url)
documentController.UTI = "com.someUTI"
documentController.delegate = self
documentController.presentOpenInMenuFromRect(CGRectZero, inView: self, animated: true)
}
The last line throws an error in Xcode: "Cannot invoke 'presentOpenInMenuFromRect' with an argument list of type..."
documentController is declared as a class variable
var documentController = UIDocumentInteractionController()
Please help me figure this out.