Does Facebook’s iPhone app use a proprietary web rendering engine instead of UIWebView?
22nd January 2012
My answer to Does Facebook’s iPhone app use a proprietary web rendering engine instead of UIWebView? on Quora
I did my first bit of iPhone development recently (building the first version of the Lanyrd iPhone app) and there was one thing that came as a huge surprise: the principle reason that people think native apps are “snappier” or “more responsive” than native ones has nothing to do with the rendering performance of a webview vs a native view (especially on the iPhone 4S which is extremely fast).
The reason webviews feel less responsive is that there is an artificial 300ms delay on link clicks (and in fact any click event) in a webview!
As I understand it, this delay exists so that the webview can tell the difference between a tap, a double tap and a tap-and-hold gesture—but the result is a noticeably different (worse) feel than a native UI component.
Thankfully, it’s possible to work around this limitation by listening to touchdown events using JavaScript instead of regular clicks. Any time you see an app with surprisingly responsive taps inside a webview (like the Facebook app, and I think the Quora app too) the app is probably using a JavaScript workaround. Here’s one pretty good explanation of the technique written by a Google engineer: http://code.google.com/mobile/ar...
For the Lanyrd app we use a combination of native views for table-style listings and web views for formatted content, with a JS workaround for clicks within the webviews. It works pretty well, but I was very frustrated at the lengths we had to go to just to avoid that nasty artificial 300ms delay!
More recent articles
- Weeknotes: Llama 3, AI for Data Journalism, llm-evals and datasette-secrets - 23rd April 2024
- Options for accessing Llama 3 from the terminal using LLM - 22nd April 2024
- AI for Data Journalism: demonstrating what we can do with this stuff right now - 17th April 2024
- Three major LLM releases in 24 hours (plus weeknotes) - 10th April 2024
- Building files-to-prompt entirely using Claude 3 Opus - 8th April 2024
- Running OCR against PDFs and images directly in your browser - 30th March 2024
- llm cmd undo last git commit - a new plugin for LLM - 26th March 2024
- Building and testing C extensions for SQLite with ChatGPT Code Interpreter - 23rd March 2024
- Claude and ChatGPT for ad-hoc sidequests - 22nd March 2024
- Weeknotes: the aftermath of NICAR - 16th March 2024