A twitter-style pull-to-refresh NSScrollView with the added functionality of delegate protocols.
Switch branches/tags
Nothing to show
Pull request Compare This branch is even with vincentmac:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
PullToRefresh.xcodeproj
PullToRefresh
.gitignore
LICENSE_PullToRefresh
LICENSE_ScrollToRefresh
README.md

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.
  1. Add a TableView or OutlineView from the Object Library to your nib file and subclass the ScrollView as a PullToRefreshScrollView.
  2. Create an outlet in your controller:
@property (weak) IBOutlet PullToRefreshScrollView *ptrScrollView;
  
  1. Set the delegate:
- (void)awakeFromNib {
    NSLog(@"awake from nib");
    [_ptrScrollView setDelegate:self];
  }
  
  1. Add the delegate method:
- (void)ptrScrollViewDidTriggerRefresh:(id)sender {
    NSLog(@"This is called by the PullToRefresh delegate protocol");
  }
  
  1. 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.