Since iOS has added WKWebView to the SDK, many people wonder how to snapshot this one, it looks like there is an issue and it's only possible to snapshot using UIGraphics to snapshot inside the simulator.
But there is few "private" methods defined within the Library WKWebView, accessible via GIT, that you can extract and access to snapshot the Webview.
I let you have a look on Gist for a detail of the code (rather simple).
Make a snapshot of a WKWebview - Gist
I can't assure that Apple would accept this solution when trying to submit to the Store. I will update this post once I have submitted an application using this technique.
First App on the Store with this code, Apple gave a Warning but it passed the review.
Does this work if you scroll the WKWebView down so you can snapshot the entire website?
ReplyDeleteHi Jee,
ReplyDeleteI didn't really try,
you may try by changing "rectInViewCoordinates" and giving the height you want,
I'll give a try if I have a time and I'll let you know :)
Hi, how can i do this in swift?
ReplyDelete