• Stars
    star
    102
  • Rank 335,584 (Top 7 %)
  • Language
    Objective-C
  • Created about 13 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An NSScrollView subclass to allow the popular "pull to refresh" from iPhone to work on Mac OS X Lion

The First Scroll To Refresh solution using only AppKit and Public APIs!

Introduction

ScrollToRefresh is a subclass of NSScrollView that adds a "pull-to-refresh" feel to the "elastic" area of NSScrollview.

ScrollToRefresh in action

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.

License

ScrollToRefresh is licensed under the MIT license meaning you can do whatever you want with it and I am not responsible for any trouble you get and you must include the license in whatever you use it in.

//  ScrollToRefresh
//
// Copyright (C) 2011 by Alex Zielenski.

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// 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.

More Repositories

1

Mousecape

Cursor Manager for OSX
Objective-C
1,206
star
2

optool

Command Line Tool for interacting with MachO binaries on OSX/iOS
Objective-C
1,120
star
3

ThemeEngine

OS X App to edit compiled .car files
Objective-C
736
star
4

ZKRevealingTableViewCell

A Sparrow-style Implementation of Swipe-To-Reveal
Objective-C
339
star
5

StartAtLoginController

A class that uses the new ServiceManagement api to allow apps to run at login.
Objective-C
206
star
6

ZKSwizzle

Streamlined way to swizzle Objective-C instance and class methods
Objective-C
135
star
7

Opee

Code Injection Platform for OS X
C
109
star
8

sartFileTool

command line tool to decode/encode SArtFile.bin
Objective-C
75
star
9

artFileTool

a tool to decode ArtFile.bin
Objective-C
72
star
10

ZKTextField

NSTextField replacement
Objective-C
72
star
11

Zeppelin

Carrier Logo Manager
Objective-C
38
star
12

Black-Mac-OS-X

A SIMBL plugin to turn 10.6.x Snow Leopard into a black tub of awesomeness.
Objective-C
33
star
13

TinyBar

iOS Tweak that thins notification banners down to size!
Objective-C
31
star
14

dockify

The application/installer used for Dockify
Objective-C
17
star
15

ZKInspector

Xcode/IB-like inspector class for OSX
Objective-C
14
star
16

FBEye

SIMBL plugin for various tweaks in the OS
Objective-C
14
star
17

ICOFamily

A class for reading and saving ICO files. Works with 64px and 24px sizes in addition to 256, 128, 48, 32, 16.
Objective-C
12
star
18

icnsmake

Command Line Tool for quickly making and exporting icns files
Objective-C
8
star
19

AutumnBoard

Icon Theming Library for 10.10
Objective-C
6
star
20

ILScopebar

A cocoa scope bar that uses an overflow menu.
Objective-C
5
star
21

dotfiles

Shell
4
star
22

repo

my cydia repo
Perl
3
star
23

Eclipse

A color theme for Xcode
1
star
24

cel-admission-polyfill

a polyfill for using CEL for admission control in kubernetes
Go
1
star
25

Grid

An online multiplayer implementation of Connect4 in javascript
JavaScript
1
star
26

eatery

FOOD!
Objective-C
1
star
27

alexzielenski.github.com

JavaScript
1
star
28

graph

1
star
29

dockify_library

The actual library used in Dockify
Objective-C
1
star
30

WWDC-2015

My 2015 WWDC Scholarship Application
Swift
1
star