Search code examples
iosswiftiphonepdfwkwebview

How remove or hide page counter of PDF from WKWebview?


How i can remove or hide a page counter from WKWebview when load a PDF file?

f

I tried the solutions that are on this link (using iOS 13.3, Swift 4.2.), but they don't work.


Solution

  • With the help of a friend, we found a solution.   In the delegate method, we can hide the UIView which contains the page counter:

    func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
        hidePDFPageCount(webView)
    }
    
    func hidePDFPageCount(_ webView: WKWebView){
        guard let last = webView.subviews.last else {
            return
        }
    
        last.isHidden = true
    }