Welcome, Guest
Username Password: Remember me

pull to refresh
(1 viewing) (1) Guest

TOPIC: pull to refresh

pull to refresh 1 year, 3 months ago #1

Does anyone have a working example of "pull to refresh"? I just started looking at EGOTableViewPullRefresh a bit ago.

So far, what I've seen either requires me to subclass UITableViewController or act as a proxy for UIScrollViewDelegate, neither of which seem possible with STV.

Thoughts?
  • fictorial
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Karma: 3
Last Edit: 1 year, 3 months ago by fictorial.

Re: pull to refresh 1 year, 3 months ago #2

Hi Brian,

This is an area that we're intending to tackle after our next STV 2.0 release. As for now:


I just started looking at EGOTableViewPullRefresh a bit ago.


I've had a quick look at their source code and I see no reason that it shouldn't be working with STV. Please tell me if you're having any issues integrating it.


So far, what I've seen either requires me to subclass UITableViewController or act as a proxy for UIScrollViewDelegate, neither of which seem possible with STV.


It's perfectly possible with STV to provide your own subclasses of UITableViewController or UIViewController. In fact, almost every sample application we ship does that. It's even possible for you to subclass UITableView if you want. STV is completely decoupled from your view controller and your table view. Again, please tell me if you're having any issues with doing that.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: pull to refresh 1 year, 3 months ago #3

I am new to STV but I don't see how I can, in the case of EGOTableViewPullRefresh, act as a proxy and tell it about scroll events.

See this.

In my case I have basically this:

 
@interface MyController : UIViewController <SCTableViewModelDataSource, SCTableViewModelDelegate>
{
UISearchBar *searchBar;
UITableView *tableView;
SCArrayOfObjectsModel *tableModel;
NSMutableArray *items;
...
}
 
//...
 
- (void)viewDidLoad
{
[super viewDidLoad];
 
items = [NSMutableArray array]; // ...
 
SCClassDefinition *classDef = [SCClassDefinition definitionWithClass:[Something class]
autoGeneratePropertyDefinitions:YES];
classDef.titlePropertyName = @"name";
 
tableModel = [[SCArrayOfObjectsModel alloc] initWithTableView:self.tableView
withViewController:self
withItems:items
withClassDefinition:classDef];
tableModel.delegate = self;
tableModel.searchBar = self.searchBar;
tableModel.searchPropertyName = @"name";
...
}
 


Thus, where might I be able to subclass UITableViewController here as in the linked EGO demo? In my case the withViewController is self which is a UIViewController. I just don't see where I can setup the table model with a subclass of UITableViewController.

I looked through the samples -- the closest one to my situation is the PeopleViewController in Core Data App. How would you subclass UITableViewController in this case?

Again, I'm new to STV since a few days so forgive me if this is something obvious! Thanks.
  • fictorial
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Karma: 3
Last Edit: 1 year, 3 months ago by fictorial.

Re: pull to refresh 1 year, 3 months ago #4

Check out this Pull To Refresh implementation:
github.com/leah/PullToRefresh

Pretty nice in my opinion. And easy to use.
  • bsimmons
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Karma: 0

Re: pull to refresh 1 year, 2 months ago #5

Yes that's nice too.

But EGO is "better" since it's used in Three20 and a bunch of other places.

I put this on the back burner for a while... but now I need to look into it again.

I have a UIViewController that has a UITableView contained within its view, among other things.

When I create the SC table model I'm setting its view controller to the UIViewController... I don't have a UITableViewController for instance.

I suppose I need to create a UITableViewController subclass, set the table view to the contained table view, and proxy the scrolling events to EGO.

Then again, I think tarekskr was adding this pull to refresh stuff to the next version?
  • fictorial
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Karma: 3

Re: pull to refresh 1 year, 2 months ago #6

Hi Brian,

STV 2.0 (due before mid March) will not include pull to refresh. After 2.0, we're planning another minor release that will address several issues relating to asynchronous data access, one of which will probably be the popular "pull to refresh".
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72
Time to create page: 1.04 seconds