Hook drag and drop mail from Apple Mail app into WKWEBVIEW

Hi,

Is it possible to hook drag and drop event from Apple Mail.app into wkwebview control?

I have a sample app which hosts wkwebview control on a view controller. This webview can navigate and open any URL. Currently this webview is configured to show one of our internal website. Now when user drag and drop an e-mail from Apple Mail.app into wkwebview, web view should be able to hook that drop event and extract the selected message as .eml file and put into our site.

is it possible to hook that drop event?


Replies

You could consider overriding -[WKWebView performDragOperation:] for this case to perform your custom handling. Unfortunately, I don’t think .eml files dragged from Mail are sensibly exposed through drop events (i.e. via DataTransfer).