Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Allow users to download PDF and view documents in other apps with WebView swift.

I just wanted to know if there was anyway to get the "Open with..." to show in the webView Controller using swift. As it is now, once users open a document, it just shows the document and does not give them the option to download it for use with other apps.

Image Idea: This is an Image Link

Shown below is my primitive webView controller:

import Foundation
import UIKit

class MoreViewController: UIViewController {

    @IBOutlet var webView: UIWebView?


    @IBAction func goBack(sender: AnyObject) {
        webView!.goBack()
    }
    @IBAction func refresh(sender: AnyObject) {
        webView!.reload()
    }


    override func viewDidLoad() {
        self.title = "Moodle"

        var url: NSURL = NSURL(string: "https://moodle.cc.sophia.ac.jp/login/index.php")!
        var urlRequest: NSURLRequest = NSURLRequest(URL: url)
        webView!.loadRequest(urlRequest)
    }
}

Any feedback will be greatly appreciated : )

hi Jonathan, Im having the same issue now, did you find how to solve it?