0

My iOS app is working with web content, and at certain time I need to take a screenshot of the web content. I'm using WKWebView (UIWebView was deprecated) for that purposes. All works fine, but recently I start to notice, that not all content appears on the screenshot. After some research, I've learned that some HTML pages have CANVAS tag, which is used for some real-time rendering/video playback. And this canvas content didn't appear on my screenshots. This quite frequently happens with ads.

I'm always using the following method for screenshot:

webView.drawHierarchy(in: rect, afterScreenUpdates: true)

At the moment, I can't find a way to take the screenshot as it appears on the screen.

Any ideas here are welcome since can't find any solutions.

Update:

Also, when trying to capture the view using Xcode debugger, it renders all the layers, view hierarchy etc.. Except that "canvas" view. It remains black.

Alex
  • 111
  • 1
  • 5

0 Answers0