0

I would like to have a WKWebView that does not display the ImagePicker but uses an image I have selected. Is something like this possible?

The Picker I wanna to hide

Mr.Kushwaha
  • 491
  • 5
  • 14
Jony
  • 111
  • 1
  • 1
  • 5

1 Answers1

-1

This image picker show on Long press event. Just remove UILongPressGestureRecognizer from your webview. Use following wkwebview extension.

extension WKWebView {

/// disable long press on Wkwebview    
func removeLongTapGestures() {
    for subView in self.scrollView.subviews {
        if let recogniserz = subView.gestureRecognizers {
            for recogniser in recogniserz {
                if recogniser is UILongPressGestureRecognizer {
                    subView.removeGestureRecognizer(recogniser)
                }
            }
        }
    }
}

}

call this function removeLongTapGestures in webview didFinish delegate method.

webView.removeLongTapGestures()
Muhammad Shauket
  • 2,643
  • 19
  • 40
  • This isn't what I was looking for. I have a website where I want to upload a picture and want to use a picture from Xcode. Removing the gesture won't do me any good. – Jony Nov 16 '18 at 16:00