GithubHelp home page GithubHelp logo

kb100824 / pulltobounce Goto Github PK

View Code? Open in Web Editor NEW

This project forked from takuoka/pulltobounce

0.0 2.0 0.0 7.05 MB

Animated "Pull To Refresh" Library for UIScrollView. Inspired by https://dribbble.com/shots/1797373-Pull-Down-To-Refresh

License: MIT License

Ruby 16.86% Swift 83.14%

pulltobounce's Introduction

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.

pulltobounce's People

Contributors

takuoka avatar schickling avatar mattleibow avatar ndlinh avatar lyc2345 avatar ndlinh-celtic avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.