Creative crypter
Creative crypter

Reputation: 1516

Swift - Load Local Html in UiWebView

I created a UiWebView where a responsive app is loaded.

Now I want to check whether the page that is accessed throws the web or the native app.

To do this I need to insert specific html in my "uiwebview".

For now I have this:

import UIKit

class ViewController: UIViewController {

    @IBOutlet var WebView: UIWebView!

    override func prefersStatusBarHidden() -> Bool {
        return true;
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        var Url = NSURL(string: "http://localhost:8888")

        WebView.loadRequest(NSURLRequest(URL: Url!))
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

}

Upvotes: 0

Views: 700

Answers (1)

Related Questions