WKWebView freezes when I start the Swifter http server
Hi guys!
I'm an experienced developer but a beginner with Swift and iOS, so your help will be very valuable. My iOS app is based on a WKWebView loading some HTML (hybrid app).
Since the WKWebView cant access to local files, I wanted to run a HTTP server on the iOS device and then use it from inside the WKWebView.
However, when I start the Swifter server like in your example, my WKWebView becomes unresponsive and completely frozen.
How can I fix that? Maybe I missed something :)
Thanks a lot!! Josh
Hey, @josh83abc 👋. It would be very helpful if you could create a sample project with your issue.
Hi, I think you need to use dispatch to main thread, like this "DispatchQueue.main.async" so you won't block main thread and your app won't freeze. But as was said above, if you have some example help could be more efficient.