0

In my iOS app I have a WKWebView that loads my website.

In my website there is a HTML form that allows users to upload images.

I want to receive when user click on this form attach button so I can request permission for Camera and Photo Library. If user rejects the access I want to dismiss the click.

If user did not select an image from photo library and clicked cancel. The WKWebView reloads my page. I do not want it to reload my page.

@IBOutlet weak var webView: WKWebView!
webView.navigationDelegate = self
webView.uiDelegate = self

Which delegate functions are suitable to my case.

malhobayyeb
  • 2,725
  • 11
  • 57
  • 91

1 Answers1

0

You might want to look into injecting a JS callback for the button's onclick event into the WKWebView with WKUserScript.

You can find a similar question and a great answer on how to do that here.

jake
  • 1,226
  • 8
  • 14