I did some digging into a (slightly) faster UIWebView-to-native communication mechanism
: A Faster UIWebView Communication Mechanism
tl;dr: Use the click() method on a dummy node (instead of location.href or the src attribute of iframes) to do fast synthetic navigations that trigger a UIWebViewDelegate 's webView:shouldStartLoadWithRequest:navigationType: method. As previously mentioned, Quip's editor on iOS is ...
7 plus ones
Shared publicly•View activity
- Couple of other ways I've used in other platforms to send data to the native wrapper: set window.status, or set window.title. I don't know if there are observers for those properties changing on iOS?Oct 18, 2013
- Awesome, but 1.4 milliseconds is still basically eternity. :-/Oct 18, 2013
Once I took that out, we spend 42% of the time getting from native to JS (about half of which seems to be preparation to execute the snippet of JS, since it's different every time). For JS to native, we also spend a lot of time constructing the URL request. All overhead because there's no direct mechanism :(Oct 19, 2013
- Updated the post to show what numbers would be if Apple exposed an official direct communication mechanism (8-10x faster). Perhaps for iOS 8.Jan 13, 2014
Add a comment...