Latest 0.0.1
Homepage https://github.com/LinkRober/RBRefresh
License MIT
Platforms ios 8.0
Frameworks UIKit, Foundation, QuartzCore
Authors

Introduction

重造一个刷新的轮子,出于正在学习Swift,新项目也是用swift写的,以前oc的刷新用起来不开森,同时也处于练练手的目的

Install

pod 'RBRefresh'

support swift3.0

Example

RBNormalHeader

RBRefresh

RBGifHeader

RBRefresh

RBBallRoateChaseHeader

RBRefresh

RBBallClipRoateHeader

RBRefresh

RBBallScaleHeader

RBRefresh

How to use

所有自定义的header和footer,需要遵循 PullDownToRefreshViewDelegate PullUpToRefreshViewDelegate,并且时UIView的范型。
在使用的时候只需要把它们作为入参传入animator如下
header和footer的frame只需要传高度的参数即可

self.tableview.rb_addHeaderRefreshBlock({
                DispatchQueue.main.asyncAfter(deadline:.now() + 1) {
                    self.datasource.removeAll()
                    self.tableview.reloadData()
                    for _ in 0 ..< 10 {
                        self.datasource.append(self.randNumber())
                    }
                    self.tableview.rb_resetNoMoreData()
                    self.tableview.rb_endHeaderRefresh()
                    self.tableview.reloadData()
                }
            }, animator:RBNormalHeader.init(frame: CGRect(x:0,y:0,width:0,height:50)))
self.tableview.rb_addFooterRefreshBlock({
            OperationQueue().addOperation {
                sleep(1)
                OperationQueue.main.addOperation {
                    self.tableview.rb_endFooterRefresh()
                    self.datasource.append(contentsOf: [24,25].map({ (n:Int) -> Int in
                        return self.randNumber()
                    }))
                    self.tableview.reloadData()
                }
            }
        }, animator: RBNormalFooter.init(frame: CGRect(x:0,y:0,width:0,height:50)))

Reach Me

HomePage:@董二千
GitHub:LinkRober

Latest podspec

{
    "name": "RBRefresh",
    "version": "0.0.1",
    "summary": "a component of ui for refresh data.",
    "description": "a component of ui for refresh data.it is convenience",
    "homepage": "https://github.com/LinkRober/RBRefresh",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Robert": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/LinkRober/RBRefresh.git",
        "tag": "0.0.1"
    },
    "source_files": [
        "Refresh",
        "Refresh/**/*.{h,m}"
    ],
    "exclude_files": "Classes/Exclude",
    "frameworks": [
        "UIKit",
        "Foundation",
        "QuartzCore"
    ],
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This