SVPullToRefresh
Give pull-to-refresh & infinite scrolling to any UIScrollView with 1 line of code.
An Objective-C library that adds pull-to-refresh and infinite scrolling to any iOS scroll view with a single line of code each, no subclassing required.
SVPullToRefresh is an Objective-C library for iOS apps that adds two common scrolling behaviors to any scrollable view: pull-to-refresh and infinite scrolling. Pull-to-refresh lets users drag a list downward past the top to trigger a data reload, the gesture popularized by many mobile apps. Infinite scrolling automatically loads more content when a user reaches the bottom of a list, so it feels continuous rather than paginated.
The library attaches both features to standard iOS scroll views with a single line of code each, so you do not need to subclass a view controller or set up delegates to wire it up. You pass in a block of code that runs when the gesture triggers, do your data fetching inside that block, and then call a stop method when the work is finished. The pull-to-refresh indicator can also appear at the bottom of the list rather than the top, which is useful for certain layouts.
Both the pull-to-refresh view and the infinite scrolling view support visual customization. You can set the arrow color, text color, and spinner style, update the title and subtitle labels for different states (idle, pulling, loading), or swap in a completely custom view to replace the default indicator entirely.
Under the hood the library works by observing the scroll view's content offset using key-value observing, a standard iOS pattern for watching property changes. It extends UIScrollView using Objective-C categories rather than subclassing, which is why it can attach to any existing scroll view in a project without requiring changes to the view hierarchy.
Installation is available through CocoaPods with a one-line entry in the Podfile, or manually by dragging the source files into a project. A demo Xcode project is included in the repository. The library is no longer actively developed but remains widely referenced as an early example of how to implement these patterns cleanly in Objective-C.
Where it fits
- Add pull-to-refresh to an iOS table view so users can drag down to trigger a data reload.
- Add infinite scrolling to a list so more items load automatically when users reach the bottom.
- Customize the pull-to-refresh indicator with custom colors, state labels, or a fully custom view.