iOS App用WKWebView加载h5, h5多页面手势返回,h5返回App

1. 创建webView时使用:作用是允许h5多页面,手势滑动

wkWebView.allowsBackForwardNavigationGestures = true

 2. 因为App系统自带侧滑手势返回,所以要这样做:

        //监听侧滑手势
        let swiperGesture = UISwipeGestureRecognizer(target: self, action: #selector(handleNavigationTransition(_:)))
        swiperGesture.delegate = self // 设置手势代理,拦截手势触发
        view.addGestureRecognizer(swiperGesture)
        navigationController?.interactivePopGestureRecognizer?.isEnabled = true
        navigationController?.interactivePopGestureRecognizer?.delegate = self

 

iOS App用WKWebView加载h5, h5多页面手势返回,h5返回App

上一篇:web工程中各类地址写法的总结


下一篇:aspose.cell 设置excel里面的文字是超链接