I'm trying to open a .pdf file after download which is downloaded with Alamofire. But I've seen only using a "webview". Thus the application consumes lots of memory and is not viable.
What I want is to open it with the native device application. Any suggestions? Thank you.
Edit: This is my code for download file:
var localPath: NSURL? Alamofire.download(.GET, url, destination: { (temporaryURL, response) in let directoryURL = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0] let pathComponent = response.suggestedFilename localPath = directoryURL.URLByAppendingPathComponent(pathComponent!) return localPath! }) .response { (request, response, _, error) in if error != nil { // got an error in getting the data, need to handle it print("Error: \(error!)") } //print(response) print("Download file en:\(localPath!)") self.view.hideToastActivity() //self.actioncall() } } I need open file from localpath...