Demo - Installation - Documents - Contribution
LNRefresh Is a lightweight, can dynamically expand the drop-down refresh component
UIScrollView
、UITableView
、UICollectionView
、UIWebView
、UITextView
GIF picture from 华尔街见闻
Style | Demo |
---|---|
Usually style | |
Dynamically change the style |
APP | Demo |
---|---|
京东 | |
天猫 | |
淘宝 | |
考拉海购 | |
美团外卖 | |
网易新闻 | |
今日头条 | |
飞猪 |
Installation with CocoaPods:
pod 'LNRefresh'
Installation with Cartfile:
github "wszoo/LNRefresh"
__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];
}];
//UITableView
[self.tableView endRefreshing];
//UICollectionView
[self.collectionView endRefreshing];
//UIWebView
[self.webView.scrollView endRefreshing];
//UITableView
[self.tableView addInfiniteScrolling:^{
[wself loadMoreRefresh];
}];
//UICollectionView
[self.collectionView addInfiniteScrolling:^{
[wself loadMoreRefresh];
}];
//UITableView
[self.tableView endLoadingMore];
//UICollectionView
[self.tableView endLoadingMore];
//UITableView
[self.tableView noticeNoMoreData];
//UICollectionView
[self.tableView noticeNoMoreData];
[self.scrollView startRefreshing];
self.tableView.ln_header.animator.trigger = 100;
+ (void)setAllHeaderAnimatorStateImages:(NSArray *)stateImages
state:(LNRefreshState)state;
+ (void)setAllHeaderAnimatorStateImages:(NSArray *)stateImages
state:(LNRefreshState)state
duration:(NSTimeInterval)duration;
+ (void)changeAllHeaderAnimatorType:(LNRefreshHeaderType)type;
+ (void)changeAllHeaderAnimatorType:(LNRefreshHeaderType)type
bgImage:(UIImage *)image;
+ (void)changeAllHeaderAnimatorType:(LNRefreshHeaderType)type
bgImage:(UIImage *)image
incremental:(CGFloat)incremental;
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
Example: LNHeaderAnimator+Analysis.m
Copyright (c) 2017 vvusu