Animated "Pull To Refresh" Library for UIScrollView.

Overview

PullToBounce

Platform Language License CocoaPods

Animated "Pull To Refresh" Library for UIScrollView.

You can add animated "pull to refresh" action to your UIScrollView, UITableView and UICollectionView.

Inspired by https://dribbble.com/shots/1797373-Pull-Down-To-Refresh

Objective-C version is here.

Xamarin.iOS version is here.

ScreenShot

Demo GIF Animation

You can play demo at appetize.io.

Installation

You can install this to your project via CocoaPods.

pod 'PullToBounce'

Usage

Please Wrap your scroll view

// Please wrap your scroll view
tableView.frame = yourFrame
let tableViewWrapper = PullToBounceWrapper(scrollView: tableView)

// Please add wrapper view to your view instead of your scroll view.
bodyView.addSubview(tableViewWrapper)

The frame of wrapper will be same as your scrollView.

And the color will be same as your scrollView's background color.

Event Handler

tableViewWrapper.didPullToRefresh = {
    didFinishYourLoading() {
        tableViewWrapper.stopLoadingAnimation()
    }
}

Custom Animation

Default arguments of "init" of PullToBounceWrapper

init(
  scrollView: UIScrollView, // this is the only required argument
  bounceDuration: CFTimeInterval = 0.8,
  ballSize:CGFloat = 36,
  ballMoveTimingFunc: CAMediaTimingFunction = CAMediaTimingFunction(controlPoints:0.49,0.13,0.29,1.61),
  moveUpDuration: CFTimeInterval = 0.25,
  pullDistance: CGFloat = 96,
  bendDistance: CGFloat = 40,
  didPullToRefresh: (()->())? = nil
)

You can use these arguments to customize animation.

You might also like...
An easy way to use pull-to-refresh.
An easy way to use pull-to-refresh.

MJRefresh An easy way to use pull-to-refresh 📜 ✍🏻Release Notes: more details Contents New Features Dynamic i18n Switching SPM Supported Swift Chaini

GIFRefreshControl is a pull to refresh that supports GIF images as track animations.
GIFRefreshControl is a pull to refresh that supports GIF images as track animations.

GIFRefreshControl GIFRefreshControl is a pull to refresh that supports GIF images as track animations. Installation You have multiple choices here: Co

Pull-to-refresh animation in UICollectionView with a sticky header flow layout, written in Swift :large_orange_diamond:
Pull-to-refresh animation in UICollectionView with a sticky header flow layout, written in Swift :large_orange_diamond:

ReplaceAnimation Implementation of Zee Young's Dribbble animation (https://dribbble.com/shots/2067564-Replace) Info I really liked Zee Young's animati

ESPullToRefresh is an easy-to-use component that give pull-to-refresh and infinite-scrolling implemention for developers.
ESPullToRefresh is an easy-to-use component that give pull-to-refresh and infinite-scrolling implemention for developers.

ESPullToRefresh is an easy-to-use component that give pull-to-refresh and infinite-scrolling implemention for developers.

An easy way to use pull-to-refresh
An easy way to use pull-to-refresh

CRRefresh an easy way to use pull-to-refresh, If you want to customize its UI style, you just need conform the specified protocol. We will not regular

PullToRefreshSwiftUI - Pull to refresh for SwiftUI
PullToRefreshSwiftUI - Pull to refresh for SwiftUI

PullToRefreshSwiftUI Pull to refresh for SwiftUI. Usage with @State import Swift

✳️ SwiftUI Pull to Refresh (for iOS 13 and iOS 14) package.

Refreshable ✳️ SwiftUI Pull to Refresh (for iOS 13 and iOS 14) package. See complementary article at SwiftUI Pull to Refresh (for iOS 13 and iOS 14).

PullToRefresh extension for all UIScrollView type classes with animated text drawing style
PullToRefresh extension for all UIScrollView type classes with animated text drawing style

PullToRefreshCoreText PullToRefresh extension for all UIScrollView type classes with animated text drawing style Demo Install Manual Copy the files in

Simple way to add parallax header to UIScrollView/UITableView written in Swift.
Simple way to add parallax header to UIScrollView/UITableView written in Swift.

ParallaxHeader Simple way to add parallax header to UIScrollView or it's subclasses. One image view Slider with images Blur vibrant text Blur round ic

Comments
  • Can't implement this on Swift 4.2 xCode 10

    Can't implement this on Swift 4.2 xCode 10

    I have tried to get this working in my project in Swift 4 but when i add the control, my scrollview content doesn't load and it just loads with a white view in the scrollview.

    MY view hierarchy is as follows: UIViewController -> View -> ScrollView -> 3x UIViews & 3x UICollectionViews

    The scrollview is implemented via the storyboard with the layout constraints that is is aligned top, leading, trailing, bottom to the main view controller view.

    I want to add the pull to refresh to my scrollview

    I have done the following code, and tried variations but it doesn't work:

    // Please wrap your scroll view scrollView.frame = self.view.frame let tableViewWrapper = PullToBounceWrapper(scrollView: scrollView) // Please add wrapper view to your view instead of your scroll view. self.view.addSubview(tableViewWrapper)

    I've also tried creating a new UIview bodyview per your tutorial: let bodyView = UIView() bodyView.frame = scrollView.frame let tableViewWrapper = PullToBounceWrapper(scrollView: scrollView) bodyView.add(tableViewWrapper) self.view.addSubview(bodyView)

    I'm either missing something very simple, or something isn't working and would appreciate some guidance if you're able to!

    opened by jshrager 0
  • autoLayout

    autoLayout

    when i used snp layout llike ` func createTableview() -> Void { let changeCityTableView = ChangeCityTableView() self.view.addSubview(changeCityTableView) changeCityTableView.snp.makeConstraints { (make) in make.edges.equalToSuperview() }

        let tableViewWrapper = PullToBounceWrapper(scrollView: changeCityTableView)
        self.view.addSubview(tableViewWrapper)
    
        tableViewWrapper.didPullToRefresh = {
            Timer.schedule(delay: 2) { timer in
                tableViewWrapper.stopLoadingAnimation()
            }
        }
    }
    

    ` a crash open assert(false, "Wow, scrollView.frame is CGRectZero. Please set frame size.")

    opened by PlutusCat 0
  • Trying to do it with a scrollView already implemented in the Storyboard.

    Trying to do it with a scrollView already implemented in the Storyboard.

    As the issue title says, I am trying to use it with a scrollView made via the storyboard. Do you guys know how to implement it, and use it ?

    Regards,

    Hary.

    opened by HarishHary 0
Owner
Takuya Okamoto
Product Designer
Takuya Okamoto
Custom animated pull-to-refresh that can be easily added to UIScrollView

PullToMakeSoup Custom animated pull-to-refresh that can be easily added to UIScrollView Check this article on our blog to know more details about anim

Yalantis 1.9k Dec 17, 2022
Give pull-to-refresh & infinite scrolling to any UIScrollView with 1 line of code.

SVPullToRefresh + SVInfiniteScrolling These UIScrollView categories makes it super easy to add pull-to-refresh and infinite scrolling fonctionalities

Sam Vermette 4.9k Dec 1, 2022
LCPullRefresh - Use UIActivityIndicatorView to provide a pull-to-refresh function for UIScrollView.

LCPullRefresh Use UIActivityIndicatorView to provide a pull-to-refresh function for UIScrollView. Requirements iOS 8.0+ Xcode 11.0+ Usage Pull-up refr

LiuChang 7 Aug 5, 2022
Animated, customizable, and flexible pull-to-refresh framework for faster and easier iOS development.

KafkaRefresh Animated, customizable, and flexible pull-to-refresh framework for faster and easier iOS development. Report bug · Request feature · 中文文档

H. H. Hsiang 1.2k Dec 11, 2022
Pull to refresh functionality for any ScrollView in SwiftUI!

SwiftUIPullToRefresh Pull to refresh is a common UI pattern, supported in UIKit via UIRefreshControl. (Un)surprisingly, it's also unavailable in Swift

Gordan Glavaš 185 Dec 29, 2022
Elastic pull to refresh for iOS developed in Swift

DGElasticPullToRefresh Elastic pull to refresh compontent developed in Swift Inspired by this Dribbble post: Pull Down to Refresh by Hoang Nguyen Tuto

Danil Gontovnik 3.7k Jan 3, 2023
Fully customizable pull-to-refresh control inspired by Storehouse iOS app

CBStoreHouseRefreshControl What is it? A fully customizable pull-to-refresh control for iOS inspired by Storehouse iOS app ![screenshot1] (https://s3.

Suyu Zhang 4k Jan 6, 2023
Customizable pull-to-refresh control,written in pure Swift.

What is it This project is heavily inspired by CBStoreHouseRefreshControl which is Objective-C implemented. SurfingRefreshControl provides you a chanc

Peiwei 55 Aug 21, 2022
One gesture, many actions. An evolution of Pull to Refresh.

MNTPullToReact MNTPullToReact is an extended evolution of the famous Pull to Refresh interaction. The main idea comes from a unique question: can the

Mention 777 Nov 20, 2022
Play BreakOut while loading - A playable pull to refresh view using SpriteKit

BreakOutToRefresh Play BreakOut while loading - A playable pull to refresh view using SpriteKit BreakOutToRefresh uses SpriteKit to add a playable min

Dominik Hauser 2.5k Dec 29, 2022