Swift version: 5.0
One of the many advantages of
UIWebView is its ability to draw on some of the native user interface of Safari. It's a long way from the
SFSafariViewController that was introduced in iOS 9.0, but you can enable the built-in gestures that let users go back and forward by swiping left and right.
Here's the code:
webView.allowsBackForwardNavigationGestures = true
HACKING WITH SWIFT LIVE This July is a new two-day event where you'll be inspired by great speakers on day one then learn all the amazing new features from WWDC on day two – click here for more information and tickets.
Available from iOS 8.0 – see Hacking with Swift tutorial 4
Did this solution work for you? Please pass it on!
Other people are reading…
About the Swift Knowledge Base
This is part of the Swift Knowledge Base, a free, searchable collection of solutions for common iOS questions.