I\'ve implemented a straight forward WKWebView
in iOS.
var refreshControl = UIRefreshControl()
refreshControl.addTarget(self, action: Sel
Try to change your code like this, If you want to pull to refresh
the webView
you need to addSubView
UIRefreshControl
object in the ScrollView
of webView
like this
let refreshControl = UIRefreshControl()
refreshControl.addTarget(self, action: #selector(self.refreshWebView(_:)), forControlEvents: UIControlEvents.ValueChanged)
webView.scrollView.addSubview(refreshControl)
Add func like this
func refreshWebView(sender: UIRefreshControl) {
print("refersh")
webView.loadRequest(NSURLRequest(URL: NSURL(string: "https://google.com")!))
sender.endRefreshing()
}
Hope this will help you.