class ViewController: UIViewController, UIGestureRecognizerDelegate, UIWebViewDelegate {
@IBOutlet weak var webView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
webView.delegate = self
DispatchQueue.main.async {
let req = URLRequest(url: URL(fileURLWithPath: Bundle.main.path(forResource: self.strTitle+"/index" , ofType: "html")!))
self.webView.loadRequest(req)
}
let tapGestureRecognizer = UITapGestureRecognizer(target:self, action:#selector(self.goToback))
tapGestureRecognizer.delegate = self
tapGestureRecognizer.numberOfTapsRequired = 2
webView.isUserInteractionEnabled = true
webView.addGestureRecognizer(tapGestureRecognizer)
}
func gestureRecognizer(_: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith:UIGestureRecognizer) -> Bool {
return true
}
func goToback() {
print("On the Back")
}