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 html 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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…