Skip to content

Commit

Permalink
Add usage to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Zielenski committed Apr 8, 2012
1 parent e33c974 commit ed46bf3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ ScrollToRefresh is a subclass of NSScrollView that adds a "pull-to-refresh" feel

![ScrollToRefresh in action](https://github.com/alexzielenski/ScrollToRefresh/raw/master/screenshot.png "Scroll To Refresh")

Usage
================

1. Set the class of your scroll view to ```EQSTRScrollView```
2. Set the `-refreshBlock` of your scroll view to a block to run some code when the refresh starts.
3. When you know that your processing is finished, call `-stopLoading` on the scroll view to remove the refresh view.
4. PROFIT


How it works
================
The secret is actually knowing how scroll views work. When you scroll, the clip view offsets the origin of its `-bounds` so any subview within the clipview will scroll. It also employs a couple of other methods to check the boundaries of the document view which I override to include the refresh view to get a more natural feel.
Expand Down Expand Up @@ -34,4 +43,4 @@ ScrollToRefresh is licensed under the MIT license meaning you can do whatever yo
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// THE SOFTWARE.

0 comments on commit ed46bf3

Please sign in to comment.