Hey StackOverflow People,
I've been trying to figure out this question for some time now but to no avail and I need some help. I have a UITableView
close to the bottom of my app and there's not enough screen distance for the user to engage the refresh. Does anybody know how I can shorten the distance it takes to activate the pull to refresh action (via a UIRefreshControl
in iOS 6/7) on a UITableView
andUIWebView
?
Thanks in advance everyone!
As per the Apple Docs, I don't see any way to modify
UIRefreshControl
parameters.link: https://developer.apple.com/library/ios/documentation/uikit/reference/UIRefreshControl_class/Reference/Reference.html
Use a third-party component like ODRefreshControl (to customize the scroll-distance in order to activate the refresh, modify the
#define kMaxDistance
constant).or...
Don't use the
UIRefreshControl
and instead implement your own logic in the-scrollViewDidScroll
method like:you can still use refreshControl but with some modifications!
add these code to your viewController:
and as usual in the end of your refresh logic in self.refresh() function add :
you can make it right with some modification
every PullToRefresh must have couple lines of code like this, that handleRefresh function, do whatever you need to refresh the page.
you just need to comment out addTarget line and add this function to your code ```
I wrote this code with the help of Ashkan Ghodrat's answer