How to detect UIWebview crash in iOS 11?

I have one UIWebView. I am trying to implement a drag and drop function ios11. When I drag an item from Safari and transfer it to mine UIWebView, I want to know which delegate method will be called. Any suggestions?

+6
source share
2 answers

Most UIWebview functions are implemented in the undocumented UIWebBrowserView class. This is a view that has its “interaction” property, and the delegate for these interactions is set to the same UIWebBrowserView.

There are 3 options for detecting a fall, depending on your needs:

1) javascript -, . :

document.addEventListener('drop', function() {
     // Drop detected
} ) ;

2) UIWebBrowserView. , . :

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

, :

 UIDropInteraction *dropInteration = [[UIDropInteraction alloc]initWithDelegate:myController] ;
 [webView addInteraction:dropInteration] ;
 webView.userInteractionEnabled = YES ;

UIDropInteractionDelegate 'myController'

3) swizle UIWebBrowserView UIDropInteractionDelegate .

+3

All Articles