Filip Němeček 5/22/2020

Using WKWebView in headless mode

Read Original

This technical article addresses a common pitfall when using WKWebView in headless (background) mode in iOS. It explains that WKWebView optimizes resource usage when not attached to a visible view hierarchy, which can break JavaScript execution. The solution provided is to instantiate the WKWebView with a zero-size frame and add it as a subview to the app's main window, ensuring it behaves correctly. It also notes a relevant change for multi-window support starting in iOS 13.

Using WKWebView in headless mode

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser