Giter Site home page Giter Site logo

easypull's Introduction

EasyPull

Let pull-to-refresh Easy for any UIScrollView in Swift

You have the flexibility to set custom view with fantastic animation.(可以灵活的设置自定义效果,实现期望的动画)


Usage

(see sample Xcode project in /Demo)

Adding Drop Pull to Refresh (添加下拉刷新)

Only support Manual Mode(仅支持手动模式)

 tableView.easy_addDropPull({
     // prepend data to dataSource, insert cells at top of table view
     // call tableView.easy_stopDropPull() when done
 })

Note: You can trigger drop-excuting directly using this method. (用下面这个方法,你可以直接触发下拉刷新操作)

 func easy_triggerDropExcuting()

Adding Up Pull to Refresh and Load more (添加上拉加载)

Manual Mode(手动模式)

 tableView.easy_addUpPullManual({
     // prepend data to dataSource, insert cells at bottom of table view
     // call tableView.easy_stopUpPull() when done
 })

Automatic Mode(自动模式)

 tableView.easy_addUpPullAutomatic({
     // prepend data to dataSource, insert cells at bottom of table view
     // call tableView.easy_stopUpPull() when done
 })

Customization

The pull-to-refresh view can be customized using the following methods:

 func easy_addDropPull(action: (() ->Void), customDropView: EasyViewManual? = nil)
 func easy_addUpPullManual(action: (() ->Void), customUpView: EasyViewManual? = nil)
 func easy_addUpPullAutomatic(action: (() ->Void), customUpView: EasyViewAutomatic? = nil)

NOTE: Your custom views must implement the EasyViewManual protocol when you prefer the Manual mode

Or implement the EasyViewAutomatic protocol when you prefer the Automatic mode.

(如果需要手动模式,你的自定义view必须实现EasyViewManual协议。如果需要自动模式,你的自定义view则必须实现EasyViewAutomatic协议。)

(see sample Xcode project in /Demo/MyCusyomView.swift or /Demo/EasyPull/DefaultView.swift)

Installation

CocoaPods

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'EasyPull', '~> 1.1.0'

Source files

Alternatively you can directly add the /EasyPull/EasyPull source files to your project.

License

This code is distributed under the terms and conditions of the MIT license.

easypull's People

Contributors

ronghaopger avatar

Watchers

Carabineiro 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.