Latest 2.0.1
Homepage https://github.com/jamalping/XPRefresh
License MIT
Platforms ios 8.0, requires ARC
Authors

Swift 版下拉刷新控件

Use:

before:

tableView.xp_header = Header.init {
    print("正在刷新")
}

tableView.xp_footer = Footer.init{
    print("上拉正在刷新")
    self.numbers+=5
}

now:

tableView.xp.setHeader({
            print("刷新之前做什么")
        }, refreshing: {
            print("正在刷新")
            self.numbers = 10
            self.perform(#selector(ViewController.test), with: nil, afterDelay: 2)
        }) {
            print("刷新结束之后做什么")
        }

        tableView.xp.setFooter(refreshing: {
            print("上拉正在刷新")
            self.numbers+=5
            self.tableView.reloadData()
            self.perform(#selector(ViewController.test), with: nil, afterDelay: 2)
        })
        // 辅助方法,结束刷新
        @objc func test() -> Void {
        self.tableView.reloadData()
        tableView.xp_header?.endRefresh()
        tableView.xp_footer?.endRefresh()
    }

image

PS:

暂时只提供了简单的刷新,后续会增加其他样式

Latest podspec

{
    "name": "XPRefresh",
    "version": "2.0.1",
    "summary": "Swiftu7248u5237u65b0u63a7u4ef6.",
    "homepage": "https://github.com/jamalping/XPRefresh",
    "license": "MIT",
    "authors": {
        "jamalping": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/jamalping/XPRefresh.git",
        "tag": "2.0.1"
    },
    "source_files": "XPRefresh/**/*.swift",
    "resources": "XPRefresh/XPRefresh.bundle",
    "requires_arc": true,
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This