Cocoanetics (ex-Dr. Touch) has a good article explaining"pull to refresh" internal workings, well worth investing the time and effort to read. Recommended! However he's solution was not reusable for me, since I don't have UITableViewController. Fortunately he referenced Enormego's solution using UITableViews, including a walk-through with changes.
Btw if you have several lists, which each need to have different state texts, try this method to add optional list specific state messages:
Header:
NSArray *stateText;Code:
@property (nonatomic, copy) NSArray *stateText;
-(void)setStateUse:
{
...
case EGOOPullRefreshPulling:
if (self.stateText)
statusLabel.text = [self.stateText objectAtIndex:0];
else
statusLabel.text = @"Release to refresh...";
...
}
- (void)dealloc
{
[stateText release]; stateText = nil;
...
}
refreshHeaderView.stateText = [NSArray arrayWithObjects: @"Release...", @"Pull...", @"Load...", nil];EGOTableViewPullRefresh is fourth "pull to refresh" sample project I'm checking, required several small changes and heavy integration to fit the purpose (five lists of three different types). Not sure, if I'll take this into use, but so far it's the one that actually worked.
No comments:
Post a Comment