I have a WebView in my app.
Because it is a tabbed application I'm not able to add buttons for going back/forward on the website.
I want to go back/forward by swiping. Right swipe from the left side/edge is back… like in Safari browser for iOS.
How can I do it? I think i should use "Screen Edge Pan Gesture Recognizer", right?
Answer in Swift 3 & Swift 4
If anyone is still having problems. This worked for me:
Find "didFinish" add / replace the following code.
The main code you need is just one line. It comes after self.didFinish() but still within the {} brackets.
webView.allowsBackForwardNavigationGestures = true
Accepted answer in Swift 3:
Gabriel Madruga's answer worked for me. I reduced the lines of code further by:
Add the following lines of code in viewDidLoad()
Your final result should look like this:
Why not just use a swipe gesture recognizer?