Hi developers is there any chanse to disable Zoom-Out & Zoom-In in WkWebView?
here's all my code so far keep in mind i'm only displaying a web in webView i don't have any other functions 😕
import UIKit
import WebKit
class ViewController: UIViewController, WKNavigationDelegate {
@IBOutlet var webView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
displayWebPage()
let preferences = WKPreferences()
preferences.javaScriptEnabled = true
let configuration = WKWebViewConfiguration()
configuration.preferences = preferences
let webView = WKWebView(frame: .zero, configuration: configuration)
// Do any additional setup after loading the view, typically from a nib.
}
private func displayWebPage() {
let url = URL(string: "hee hee")
let request = URLRequest(url: url!)
webView.navigationDelegate = self
webView.load(request)
webView.sizeToFit()
}
func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) {
print(error)
}
}