Back in November 2012, we released Tumblr for iOS 3.2, our first fully native version. Version 3.0, a from-scratch rewrite which came out the previous June, had plenty of native code as well but used web views to render lists of posts. At the time, I wrote:
The decision to use a web view had nothing to do with cross-platform compatibility or ease of development and everything to do with needing to render (somewhat) arbitrary HTML, provided by our users. This makes building a Tumblr iOS app of the highest caliber an interesting challenge.
As noted by Zach Williams, we used GRMustache to render the post lists and Zepto.js was used to implement the web view’s behavior, with some slight modications (the
longTapevent didn’t work exactly the way we wanted,
tapwouldn’t play HTML5 audio, and we needed to prevent touches while scrolling). CSS classes were used instead of
Suitable scrolling performance was difficult to achieve in the web view as lists of Tumblr posts are usually extremely media-heavy. Some of the measures we took included using images in place of border-radius and box-shadow CSS and scaling/compressing photos on our servers, to the exact size needed on the phone.
We’re a long way from June 2012, and I’m not sure I’d recommend copying anything in there today, but I hope you find it interesting nonetheless!