6
import UIKit
import WebKit
class ViewController: UIViewController, WKNavigationDelegate {
var webView : WKWebView!
override func loadView() {
webView = WKWebView()
webView.navigationDelegate = self
self.view = webView
}
override func viewDidLoad() {
super.viewDidLoad()
let url = NSURL(string: "http://boooo.com")
webView.loadRequest(NSURLRequest(URL: url!))
webView.allowsBackForwardNavigationGestures = true
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}
一切工作正常,但allowBackForwardNavigationGestures = true在xcode 7.1中不起作用。無法在wkwebview中前進和後退。allowedBackForwardNavigationGestures = true在xcode 7.1中不起作用