最佳答案
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.