leah / pulltorefresh Goto Github PK
View Code? Open in Web Editor NEWA simple iPhone TableViewController for adding pull-to-refresh functionality.
Home Page: http://blog.leahculver.com/2010/07/iphone-pull-to-refresh.html
License: MIT License
A simple iPhone TableViewController for adding pull-to-refresh functionality.
Home Page: http://blog.leahculver.com/2010/07/iphone-pull-to-refresh.html
License: MIT License
For whatever reason, the initWithStyle method wasn't be called for me. This meant that the labels weren't being assigned any values. I'm assuming this happened because I'm using a NIB file.
I moved the NSString declarations into the viewDidLoad method, before the addPullToRefreshHeader method call and everything is working as expected.
Thanks for making this available!
Is there any way I could load the view and disable the pull to refresh?
My app was using the pull to refresh as a way to initiate a camera barcode scan.
However when I connect a line-pro barcode scanner I do not need the pull to scan feature. Is there a easy way to disable the pull to refresh? Or can this feature be added?
I'm new to github, so pardon the noob-ness. This implementation is fantastic and I had to do very little code changing to make it work. One thing I did notice was that, in the current implementation, my code was never entering the else if (isDragging && scrollView.contentOffset.y < 0) of the scrollView:didScroll delegate call. Thus, my arrow was never changing and my text was never updating. However, since a scrollView inherently has a dragging BOOL property, I changed the line to else if (scrollView.dragging && scrollView.contentOffset.y < 0), and it works perfectly. Now, this may be because I am not using this in a class that subclasses PullRefreshTableViewController because it's subclassing of UITableViewController didn't work for my scenario. Anyways, I hope this helps!
Hi,
First of all, can I just say thank you for such awesome code.
I am having a problem though and I'm not sure if I'm doing something really obviously wrong or not!
Basically, the cell displays the arrow and activity indicator fine but no text appears. I was wondering if you knew why this might be? I have installed as per your instructions.
Many thanks in advance!
In Xcode7.2.1, When run the demo in simulator, it crashed.
Hello.
Now the library doesn't support ARC.
As far as I know there are 2 options to solve this.
The first is adding -fno-objc-arc
compiler flag for PullRefreshTableViewController.m file in build phases tab of target configs (as described here).
The second solution doesn't need any steps for developers. I found it in ViewDeck library.
Here you can find changes.
Pay attention to the next lines of code.
#ifndef __has_feature
#define __has_feature(x) 0
#endif
#ifndef __has_extension
#define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
#endif
#if __has_feature(objc_arc) && __clang_major__ >= 3
#define II_ARC_ENABLED 1
#endif // __has_feature(objc_arc)
and
- (void)dealloc {
#if !II_ARC_ENABLED
[refreshHeaderView release];
[refreshLabel release];
[refreshArrow release];
[refreshSpinner release];
[textPull release];
[textRelease release];
[textLoading release];
[super dealloc];
#endif
}
So the question is which way is correct? And should I pull-request this changes?
thanks for great sharing
if you drag immediately after the last refresh done and before the stop loading animation done, and release the drag with half of the arrow visible(do not trigger a new refresh), the arrow will never gone. This may be fixed by clear the isLoading flag before the animation, or introducing another flag.
increase the animation duration may help on reproducing this.
hello,when i pull the height >60 ,my app is crash
Hello
I implemented PulltoRefresh. And when I tested on my TableViewController, indicator shows properly at first.
But despite of updating is finished, 'Loading...' is still running...
What's the matter with my app?
Please let me know how to fix it.
Regards
Noriaki
How can i enable pull up to refresh feature using the same. Looking for some pointers.
if ([self isOverThisVersion:@"7.0"]) {
[self setEdgesForExtendedLayout:UIExtendedEdgeNone];
}
The "Loading" cell with the rotating activity indicator will not disappear after I have refreshed. I think that this may be a problem with the way my Table Cells are created, as they call [tableView beginUpdates]; [tableView endUpdates]; to adjust for their web-based content.
in addPullToRefreshHeader method, all the sizes are hard-coded which is really bad.
For example,
refreshHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0 - REFRESH_HEADER_HEIGHT, 320, REFRESH_HEADER_HEIGHT)];
Should be:
CGSize tableViewSize = self.tableView.frame.size;
refreshHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0 - REFRESH_HEADER_HEIGHT, tableViewSize.width, REFRESH_HEADER_HEIGHT)];
I noticed this wipes out any content insets that existed on the table. Could this be modified to preserve them?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.