Latest 0.1.0
Homepage https://github.com/pgbo/UpRefreshControl
License MIT
Platforms ios 6.0, requires ARC
Frameworks UIKit
Authors

简介

使用Objective-c编写的下拉刷新控件,适用于各种UIScrollView,UITableView,UICollectionView,其特点是简洁大方。

效果图

下拉状态:
下拉可以刷新...

准备刷新状态:
释放将会刷新...

刷新中状态:
刷新中...

安装

cocoapods

将下面的语句加入到你的Podfile:

pod "UpRefreshControl", :git => "https://github.com/pgbo/UpRefreshControl.git"

手动安装

拷贝并添加或推拽UpRefreshControl目录到你的项目目录里即可。

使用

初始化并添加到UIScrollView中

_refreshControl = [[UpRefreshControl alloc]initWithScrollView:self.tableView action:^(UpRefreshControl *control){
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[control finishedLoadingWithStatus:@"Finished refresh" delay:1.f];
});
}];
[self.tableView addSubview:self.refreshControl];

结束刷新

[self.refreshControl finishedLoadingWithStatus:@"Finished refresh" delay:1.f];

在UIScrollView相关代理方法中调用UpRefreshControl的相关方法

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
[self.refreshControl scrollViewDidScroll];
}

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{
[self.refreshControl scrollViewDidEndDragging];
}

自定义

// 自定义颜色
self.refreshControl.color = [UIColor blueColor];

// 自定义触发加载更多的阀值
self.refreshControl.refreshThreshold = 100.f;

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Author

pgbo, [email protected]

License

UpRefreshControl is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "UpRefreshControl",
    "version": "0.1.0",
    "summary": "A easy and light way to use pull-to-refresh.",
    "homepage": "https://github.com/pgbo/UpRefreshControl",
    "license": "MIT",
    "authors": {
        "pgbo": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pgbo/UpRefreshControl.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://github.com/pgbo",
    "platforms": {
        "ios": "6.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "UpRefreshControl": [
            "Pod/Localized/*.lproj"
        ]
    },
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This