去掉UIWebview上的UIDragInteraction

429 阅读1分钟

长按webview上的链接会有拖拽drag,同时错误提示: CLIENT APP ERROR - Neither the view or container of the UITargetedPreview is currently in a window. This is in violation of UIDragInteraction API contract and can cause a severe visual glich. THIS IS A CLIENT APP BUG and will soon be a hard assert. PLEASE FIX ME

解决方法1: 您可以禁用UIWebBrowserView中的拖放交互(亲测有效)

 _webView.scrollView.subviews[0].interactions = @[] ;

解决方法2:

使用你自己的的UIDropInteractionDelegate方法(未测试仅供参考)

参考cn.voidcc.com/question/p-…