# QUKit **Repository Path**: mutouren_admin/QUKit ## Basic Information - **Project Name**: QUKit - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-08-13 - **Last Updated**: 2021-02-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # QUKit [![CI Status](https://img.shields.io/travis/qulunping@gmail.com/QUKit.svg?style=flat)](https://travis-ci.org/qulunping@gmail.com/QUKit) [![Version](https://img.shields.io/cocoapods/v/QUKit.svg?style=flat)](https://cocoapods.org/pods/QUKit) [![License](https://img.shields.io/cocoapods/l/QUKit.svg?style=flat)](https://cocoapods.org/pods/QUKit) [![Platform](https://img.shields.io/cocoapods/p/QUKit.svg?style=flat)](https://cocoapods.org/pods/QUKit) ## Example To run the example project, clone the repo, and run `pod install` from the Example directory first. ## Requirements ## Installation QUKit is available through [CocoaPods](https://cocoapods.org). To install it, simply add the following line to your Podfile: ```ruby pod 'QUKit' ``` ## QURefresh使用 QURefresh是列表上拉下拉扩展控件,使用如下代码导入 ```ruby pod 'QUKit/QURefresh', :path => 'https://gitee.com/mutouren_admin/QUKit.git', branch:'master' ``` 使用方法,请参考demo代码中的QURefreshTestTVC.m,设置刷新处理只需要如下设置就完了: ```ruby //有上拉下拉刷新 [self.tableView qu_setHaveHeaderFooter]; __weak __typeof(&*self)weakSelf = self; self.tableView.qu_refreshingBlock = ^(BOOL isHeaderRereshing, int page, int pageRow) { // 加载数据处理 }; ``` 示例代码: ```ruby //有上拉下拉刷新 [self.tableView qu_setHaveHeaderFooter]; __weak __typeof(&*self)weakSelf = self; self.tableView.qu_refreshingBlock = ^(BOOL isHeaderRereshing, int page, int pageRow) { // 模拟延迟加载数据,因此1秒后才调用(真实开发中,可以移除这段gcd代码) dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ if (isHeaderRereshing) { [weakSelf.tableArr removeAllObjects]; } if (page < 2) { NSMutableArray *arr = [NSMutableArray array]; for (int i=0; i<_tableView.pageRow; i++) { [arr addObject:@"111"]; } [weakSelf.tableArr addObjectsFromArray:arr]; [weakSelf.tableView qu_endRefreshStatusWithAddArr:arr apiStatus:YES errorMsg:@"加载成功!"]; } else { NSMutableArray *arr = [NSMutableArray array]; for (int i=0; i<10; i++) { [arr addObject:@"111"]; } [weakSelf.tableArr addObjectsFromArray:arr]; [weakSelf.tableView qu_endRefreshStatusWithAddArr:nil apiStatus:NO errorMsg:@"没有更多数据!"]; } }); }; ``` ## Author 284051099@qq.com ## License QUKit is available under the MIT license. See the LICENSE file for more info.