Quote:
Originally Posted by iJohnwickham
I have a tab bar app with a UIWebView in both tabs. One displaying Facebook, the other Twitter. I want to add the 'Pull Down to Update' feature, as seen in the Facebook app. Pull all the way down, the page reloads.
How can I add this to the UIWebView?
|
There's some great resources showing how to implement Pull to Update (or refresh) when using a tableView:
(this one springs to mind
iPhone Pull to Refresh - Leah Culver's Blog)
but you're going to have to adapt them in order to work with UIWebView.
The basic technique used to implement this functionality usually seems to be:
1. Add a view with the "Pull to Refresh" message and details to a UIScrollview (or subclass) and set it's frame so that it is above the top of your UIScrollview.
2. Connect a delegate to the UIScrollview and listen for the scrollViewDidScroll messages.
3. When you receive a message that the view been scrolled far enough upwards you can perform any update processing you need and reload the subviews.
I realise this is all pretty high level but it might be enough to get you started.
If you're still figuring things out I'd suggest getting the example from the page I linked, understanding it a little then trying to implement your own in order of the steps described above... hopefully I didn't miss anything.