Coder Social home page Coder Social logo

summerhh / lnrefresh Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vvusu/lnrefresh

1.0 2.0 0.0 24.21 MB

轻量级下拉刷新控件,各种动画集合(京东,天猫,淘宝,考拉海购,美团,今日头条,飞猪)

License: Other

Ruby 3.59% Objective-C 82.61% Shell 0.65% C 0.68% Makefile 12.48%

lnrefresh's Introduction

Demo - Installation - Documents - Contribution

LNRefresh

LNRefresh Is a lightweight, can dynamically expand the drop-down refresh component

Support what kinds of controls to refresh

UIScrollViewUITableViewUICollectionViewUIWebViewUITextView

Demo

GIF picture from 华尔街见闻

Style Demo
Usually style
Dynamically change the style

Customize Demos

APP Demo
京东
天猫
淘宝
考拉海购
美团外卖
网易新闻
今日头条
飞猪

Installation

CocoaPods

Installation with CocoaPods:

pod 'LNRefresh'

Carthage

Installation with Cartfile:

github "wedxz/LNRefresh"

Documents

How to use LNRefresh

Add pull to refresh
__weak typeof (self) wself = self;
//UITableView
[self.tableView addPullToRefresh:^{
  [wself pullToRefresh];
}];

//UICollectionView
[self.collectionView addPullToRefresh:^{
  [wself pullToRefresh];
}];

//UIWebView
[self.webView.scrollView addPullToRefresh:^{
   [wself.webView reload];
}];
End Pull to refresh
//UITableView
[self.tableView endRefreshing];

//UICollectionView
[self.collectionView endRefreshing];

//UIWebView
[self.webView.scrollView endRefreshing];
Add Loading more
//UITableView
[self.tableView addInfiniteScrolling:^{
  [wself loadMoreRefresh];
}];

//UICollectionView
[self.collectionView addInfiniteScrolling:^{
  [wself loadMoreRefresh];
}];
End Loading more
//UITableView
[self.tableView endLoadingMore];

//UICollectionView
[self.tableView endLoadingMore];
No More data
//UITableView
[self.tableView noticeNoMoreData];

//UICollectionView
[self.tableView noticeNoMoreData];
Auto Refresh
[self.scrollView startRefreshing];
Change the trigger to pull the refresh distance
self.tableView.ln_header.animator.trigger = 100;

Global Settings

Set the GIF image
+ (void)setAllHeaderAnimatorStateImages:(NSArray *)stateImages
                                  state:(LNRefreshState)state;

+ (void)setAllHeaderAnimatorStateImages:(NSArray *)stateImages
                                  state:(LNRefreshState)state
                               duration:(NSTimeInterval)duration;
Change the global pull-down refresh pattern state
+ (void)changeAllHeaderAnimatorType:(LNRefreshHeaderType)type;

+ (void)changeAllHeaderAnimatorType:(LNRefreshHeaderType)type
                            bgImage:(UIImage *)image;

+ (void)changeAllHeaderAnimatorType:(LNRefreshHeaderType)type
                            bgImage:(UIImage *)image
                        incremental:(CGFloat)incremental;

Customize RefreshAnimator

You Need to inherit LNHeaderAnimator,Rewrite the following method.

- (void)setupHeaderView_DIY;
- (void)layoutHeaderView_DIY;
- (void)refreshHeaderView_DIY:(LNRefreshState)state;
- (void)refreshView_DIY:(LNRefreshComponent *)view progress:(CGFloat)progress;

Example: LNHeaderDIYAnimator.m

Analysis

Example: LNHeaderAnimator+Analysis.m

Contribution

vvusu

License

Copyright (c) 2017 vvusu

lnrefresh's People

Contributors

vvusu avatar

Stargazers

 avatar

Watchers

 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.