explaingit

gontovnik/dgelasticpulltorefresh

Analysis updated 2026-07-03

3,749SwiftAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

DGElasticPullToRefresh replaces the default iOS pull-to-refresh spinner with an elastic stretching animation that makes the top of a list appear to snap like rubber when pulled down.

Mindmap

mindmap
  root((DGElasticPullToRefresh))
    What it does
      Elastic pull-to-refresh animation
      Replaces default iOS spinner
      Bezier curve spring physics
    Setup
      Few lines of Swift
      CocoaPods install
      iOS 8 plus
    Features
      Custom indicators
      Configurable colors
      Programmatic trigger
    Use Cases
      News feed apps
      Social list views
      Data reload screens
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Replace the standard iOS loading spinner with a branded elastic animation on a table view or scroll view

USE CASE 2

Create a custom animated loading indicator for your app by subclassing the provided base class and implementing three methods

USE CASE 3

Add a pull-to-refresh effect to an existing table view with just a few lines of Swift code and a custom accent color

What is it built with?

SwiftiOSCocoaPods

How does it compare?

gontovnik/dgelasticpulltorefreshkasketis/netfoxlouisdh/panelkit
Stars3,7493,7493,749
LanguageSwiftSwiftSwift
Setup difficultyeasyeasyeasy
Complexity2/51/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Requires manual cleanup before view controller deallocation, the README marks this as a temporary limitation.

Use freely in any project, commercial or personal, as long as you keep the copyright notice.

In plain English

DGElasticPullToRefresh is a Swift library for iOS that adds an animated pull-to-refresh effect to scrollable views like table lists. Pull-to-refresh is the gesture where you drag down from the top of a list to trigger a data reload. This library makes that gesture look like the top of the list stretches like elastic before snapping back, rather than using the flat spinner that iOS provides by default. The effect was inspired by an animation concept posted on Dribbble. The author also published a tutorial explaining how the elastic stretching physics were implemented using bezier curves and spring animations. Adding the effect to an existing table view takes a few lines of Swift code. You attach a refresh handler to the table view, specify a loading indicator view, set the fill color for the elastic area, and set the background color. When the user pulls down and releases, the handler fires, your data loading logic runs, and when it finishes you call a stop method to dismiss the loading state. The library includes a built-in circular loading indicator, and you can create your own by subclassing the provided base class and implementing three methods: one to track pull progress, one to start the animation, and one to stop it. Other configurable options include auto-starting the loading state programmatically, changing colors, and removing the pull-to-refresh behavior entirely when a view controller is about to be deallocated (the README notes that cleanup is required and marks it as a temporary limitation). The library can be installed via CocoaPods or by copying the source files directly. It requires iOS 8 and Xcode 7 or later, written in Swift 3. The license is MIT.

Copy-paste prompts

Prompt 1
Using DGElasticPullToRefresh in Swift, show me how to attach an elastic pull-to-refresh effect to a UITableView and trigger a network data reload when the user pulls down and releases.
Prompt 2
How do I create a custom loading indicator for DGElasticPullToRefresh by subclassing its base class and implementing the three required animation methods?
Prompt 3
Write Swift code to add DGElasticPullToRefresh with a custom fill color to a UIScrollView and programmatically trigger the loading state without any user gesture.
Prompt 4
What cleanup code must I call to safely remove DGElasticPullToRefresh from a table view before the view controller is deallocated?

Frequently asked questions

What is dgelasticpulltorefresh?

DGElasticPullToRefresh replaces the default iOS pull-to-refresh spinner with an elastic stretching animation that makes the top of a list appear to snap like rubber when pulled down.

What language is dgelasticpulltorefresh written in?

Mainly Swift. The stack also includes Swift, iOS, CocoaPods.

What license does dgelasticpulltorefresh use?

Use freely in any project, commercial or personal, as long as you keep the copyright notice.

How hard is dgelasticpulltorefresh to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is dgelasticpulltorefresh for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub gontovnik on gitmyhub

Verify against the repo before relying on details.