Introduction
MOOPullGesture implements pull gestures on table views through a UIGestureRecognizer subclass. Built to be extensible, MOOPullGesture comes with pull-to-create and pull-to-refresh.
MOOPullGesture contains MOOPullGestureRecognizer
, which tracks a table view's scrolling and communicates updates to a trigger view through a simple protocol, MOOTriggerView
.
Usage
The Demo Project
folder contains working examples of pull-to-create and pull-to-refresh.
Pull-to-create
Please see PullToCreateViewController.m
and PullToCreateDelegate.m
. Pay special attention to the UIScrollViewDelegate
methods on the delegate--it's important to forward those.
Pull-to-refresh
Take a look at PullToRefreshViewController.m
.
Installation
###First: Clone into a submodule
In your project's folder, type:
git submodule add git://github.com/peyton/MOOPullGesture.git
A submodule allows your repository to contain a clone of an external project. If you don't want a submodule, use:
git clone git://github.com/peyton/MOOPullGesture.git
###Next: Add classes
Drag MOOPullGesture/
into your Xcode project's file browser.
Note: An options dialog will pop up. If you're using MOOPullGesture as a submodule, you should uncheck "Copy items into destination group's folder (if needed)."
###Then: Add QuartzCore.framework
With your application's target selected in the navigator, click on the "Build Phases" tab. Under "Link Binary With Libraries," click the "+" button and add QuartzCore.framework
.
###Finally: Import the headers
#import "MOOPullGestureRecognizer.h"
...and a MOOTriggerView
, either MOOCreateView.h
or MOORefreshView.h
###Later: Update to the latest version
cd
into the MOOPullGesture directory and run:
git pull
Credits
Inspired by Pier-Olivier Thibault's PHRefreshTriggerView, Clear's pull-to-create, and Twitter's pull-to-refresh.