Skip to content
A twitter-style pull-to-refresh NSScrollView with the added functionality of delegate protocols.
Objective-C
Find file
Pull request Compare This branch is 6 commits ahead, 1 commit behind alexzielenski:master.
Latest commit f73abaf Apr 5, 2012 @vincentmac markdown
Failed to load latest commit information.
PullToRefresh.xcodeproj
PullToRefresh
.gitignore
LICENSE_PullToRefresh
LICENSE_ScrollToRefresh
README.md markdown Apr 5, 2012

README.md

PullToRefresh

A twitter-style pull-to-refresh NSScrollView with the added functionality of delegate protocols.

A slightly modified version of: Leah Culver's PullToRefresh and Alex Zielenski's ScrollToRefresh

Key Features

  • Elastic Scroll
  • Added optional delegate protocol method: ptrScrollViewDidTriggerRefresh:(id)sender
    • This method gets called when the user scrolls beyond the set bounds.

Directions

  1. Link against the QuartzCore framework (under Targets > Build Phases > Link Binarry With Libraries).
  2. Copy the following files to your project:
    • PullToRefreshClipView.h/PullToRefreshClipView.m;
    • PullToRefreshScrollView.h/PullToRefreshScrollView.m;
    • PullToRefreshDelegate.h;
    • pull-to-refresh-arrow.png and;
    • release-to-refresh.png.
  3. Add a TableView or OutlineView from the Object Library to your nib file and subclass the ScrollView as a PullToRefreshScrollView.
  4. Create an outlet in your controller:

    @property (weak) IBOutlet PullToRefreshScrollView *ptrScrollView;
    
  5. Set the delegate:

    - (void)awakeFromNib {
      NSLog(@"awake from nib");
      [_ptrScrollView setDelegate:self];
    }
    
  6. Add the delegate method:

    - (void)ptrScrollViewDidTriggerRefresh:(id)sender {
      NSLog(@"This is called by the PullToRefresh delegate protocol");
    }
    
  7. Customize the delegate method as needed.

License

PullToRefresh is forked from Alex Zielenski's ScrollToRefresh and is licensed under the MIT License. Please refer to the LICENSE for further details.

Something went wrong with that request. Please try again.