One of the modules of my app is a web site. That web site contains primarily an SVG drawing, with custom shaped buttons (using Raphael.js library) to access other drawings (
i had some problem but i solved problem with configuration options. here is my my code.
var a = dic["adi"]?.asString()
var path = NSBundle.mainBundle().pathForResource(a, ofType: "htm" )
var url = NSURL(fileURLWithPath:path!)
var request = NSURLRequest(URL:url!)
var theConfiguration = WKWebViewConfiguration()
theWebView = WKWebView(frame:self.view.frame, configuration: theConfiguration)
var error:NSError?
let text2 = String(contentsOfFile: path!, encoding:NSUTF8StringEncoding, error: &error)
if let theError = error
{
print("\(theError.localizedDescription)")
}
theWebView!.loadHTMLString(text2!, baseURL: nil)
self.view.addSubview(theWebView!)
hope this helps.