To autoscale a webpage inside a good old WebView in Swift, all I had to do was:
var w:UIWebView
w.scalesPageToFit=true
I cannot find an equivalent method for a WKWebView, and webpages appear too big in my app. How can I autoscale the contents of a WKWebView?
-I am using Xcode 7 and Swift
Here is my solution:
This worked for me, if there is an easier or cleaner way, let us know. In this example I resize the WKWebview everytime the device's screen orientation changes, place the code in your ViewController. In my case the website I loaded could already autosize itself in a browswer, and with this code, it will also resize inside a WKWebView: