Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
- }
- documentController.presentOpenInMenuFromRect(CGRectZero, inView: self.view, animated: true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement