iOS 下拉刷新:LGRefreshView

jopen 9年前發布 | 13K 次閱讀 iOS開發 移動開發 LGRefreshView

LGRefreshView 是 iOS 用于 UIScrollView,UITableView 和 UICollectionView 的下拉刷新。

Installation

With source code

With CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. See the "Get Started" section for more details.

Podfile

platform :ios, '6.0'
pod 'LGRefreshView', '~> 1.0.0'

Usage

In the source files where you need to use the library, import the header file:

#import "LGRefreshView.h"

Initialization

You have several methods for initialization:

- (instancetype)initWithScrollView:(UIScrollView *)scrollView; // also you can pass UITableView and UICollectionView, becose its subclasses of UIScrollView

More init methods you can find in LGRefreshView.h

Handle actions

To handle actions you can use initialization methods with blocks or delegate, or implement it after initialization.

Delegate

@property (assign, nonatomic) id<LGRefreshViewDelegate> delegate;

- (void)refreshViewRefreshing:(LGRefreshView *)refreshView;

Blocks

@property (strong, nonatomic) void (^refreshHandler)(LGRefreshView *refreshView);

Notifications

Here is also some notifications, that you can add to NSNotificationsCenter:

kLGRefreshViewBeginRefreshingNotification; kLGRefreshViewEndRefreshingNotification;

More

For more details try Xcode Demo project and see LGRefreshView.h

iOS 下拉刷新:LGRefreshView  

項目主頁:http://www.baiduhome.net/lib/view/home/1437662390990

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!