I know that this is possible in the Tweetie for iPhone or the xkcd iPhone app, but they are using a table. Any idea if this can be done for a simple UIWebView
as well? I'm aware of the Javascript suggestions in this SO question, but what about making that natively?
views:
91answers:
2
A:
In my own implementation of the 'pull to refresh' view and in an open source option, EGOTableViewPullRefresh
, the view relies on tracking the UIScrollView
with the delegate methods. I imagine this is the case in the xkcd app.
There is no such tracking available with the UIWebView
, so it rules out that option.
I guess what you could try, and it would be very complicated, is override touchesBegan:
and touchesMoved:
and try to track a finger that's scrolling the UIWebView
, then decide whether it's pulling the view down or if the user is just scrolling the page content.
Tom Irving
2010-07-11 20:15:44
So you mean that first, I need to know (by Javascript, I guess) if I am on the top of the page, and then I should start checking if the user keeps "pulling down" with the help of touchesMoved, right?
Irene
2010-07-12 10:46:58
Yup, check the position in touchesBegan: then decide whether or not to continue processing in touchesMoved:. That's how I would do it.
Tom Irving
2010-07-12 15:32:13