Can I run a UIWebView in a seperate thread?

I have a web-view running JavaScript application, and sometimes it freezes/hangs when the main thread are performing heavier jobs like xhr calls and initializing video player. Is it possible to run a UIWebView in a separate thread, to avoid the web-view from being blocked?

Answers:

Answer

UIWebView may make calls to UIKit which is in the main thread. Placing it in a separate thread will likely cause a crash. You can't create views on background threads, that's UI stuff. As Paul said in the comment, your best bet is to move anything else tying up the main thread into its own queue.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.