
import UIKitimport WebKitclass 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中前进和后退.
解决方法 看起来它干扰了navigationController的interactivePopGestureRecognizer(如果你有的话).overrIDe func vIEwWillAppear(_ animated: Bool) { super.vIEwWillAppear(animated) self.navigationController?.interactivePopGestureRecognizer?.isEnabled = false}overrIDe func vIEwWilldisappear(_ animated: Bool) { super.vIEwWilldisappear(animated) self.navigationController?.interactivePopGestureRecognizer?.isEnabled = true} 所以我在导航堆栈中使用WKWebVIEw时禁用了这个属性!
总结以上是内存溢出为你收集整理的ios – allowsBackForwardNavigationGestures = true在xcode 7.1中不起作用全部内容,希望文章能够帮你解决ios – allowsBackForwardNavigationGestures = true在xcode 7.1中不起作用所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)