wkwebview decidePolicyForNavigationAction being call after the long press recogniser ended

吃可爱长大的小学妹 提交于 2019-11-30 16:03:26

First of all, there's no need to mimic Chrome's behavior because there's little to no consequences to the whole experience. In fact, one could theorize your approach of having it show up after the finger is released is better than what Chrome and Safari is doing.

Why?

Because you are using the standard behavior of the standard long press recognition that is omnipresent throughout the entire ecosystem.

I believe Safari is showing up the action sheet while the user is pressing to give the illusion that everything is happening FAST.

Anyway, you can "fix" this by creating a custom UIWindow, implementing your own long press recognition and getting the elements of the HTML using saved coordinates. For a guide on how to create this entire behavior check this link: http://www.icab.de/blog/2010/07/11/customize-the-contextual-menu-of-uiwebview/comment-page-3/

(Objective-C)

Use UIGestureRecognizerStateBegan

A general bug: Websites will bypass the policy decision and will load the content when a touch ends.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!