gris: ThingsWeCantDo

gris: ThingsWeCantDo

From the Google Reader iPhone Sync application available to jailbroken iPhones via Cydia:

Tilt Scrolling

As seen in Instapaper Pro. But I thought of it before they implemented it ;)

Why Not?

I have working code for tilt-scroll on a UIScrollView in portrait orientation. The problem is that UIWebView is not a UIScrollView, and in fact provides no method for programatically getting or setting the content offset / scroll.

I thought so, too, even for a few weeks after the Instapaper app’s initial release. But it is indeed possible to programmatically get and set the scroll position on a UIWebView. You just have to be creative and make do with the (very few) methods that UIWebView provides.

It’s a shame, though, that it’s not a proper subclass of UIScrollView. A contentOffset property would be a lot easier. There’s an Apple Bug Reporter feature request (#5912563) open for UIWebView to get contentOffset, but I’m not sure whether it’s a priority.

Related Posts