This one is driving me crazy early this morning. I want to load some local html into a web view:
class PrivacyController: UIViewController {
@IBOutlet w
For swift 3 Use this:
do
{
let testHTML = Bundle.main.path(forResource: "about", ofType: "html")
let contents = try NSString(contentsOfFile: testHTML!, encoding: String.Encoding.utf8.rawValue)
let baseUrl = NSURL(fileURLWithPath: testHTML!) //for load css file
mWebView.loadHTMLString(contents as String, baseURL: baseUrl as URL)
}
catch
{
}