jeudi 30 octobre 2014

Load local html into UIWebView using swift


Vote count:

0




This one is driving me crazy early this morning. I want to load some local html into a web view:



class PrivacyController: UIViewController {

@IBOutlet weak var webView:UIWebView!

override func viewDidLoad() {
let url = NSURL(fileURLWithPath: "privacy.html")
let request = NSURLRequest(URL: url!)
webView.loadRequest(request)
}
}


The file is located in the root folder of my project but is inside a group. The webview is blank for me. Any ideas whats wrong? I am on xcode 6.1 and running this example on my iphone 6.



asked 28 secs ago







Load local html into UIWebView using swift

Aucun commentaire:

Enregistrer un commentaire