I got a UIWebView and I load the content like that
let url = NSURL (string: "http://www.myresponsivesite.fr/section/");
let requestObj = NSURLRequest(URL: url!);
webView.loadRequest(requestObj);
It's working perfectly but I would like to put some div and other elements in display none. So my question is : How can I inject some css from my app with swift? Thanks.
I finally found another way, I load my html in a variable and, i replace some div with a "display:none" exemple :
and I replace what i want
I found a couple post on it and the Apple docs, here was one solution:
website.stringByEvaluatingJavaScriptFromString(loadStyles)
Here is the other post: Swift stringByEvaluatingJavaScriptFromString
Then the Apple docs.