Latest 0.1.1
Homepage https://github.com/FCXPods/SwiftFCXRefresh
License MIT
Platforms ios 8.0, requires ARC
Authors

常用的上下拉刷新功能都支持可自定义,只需简单的两三行代码即可完成,主要支持以下功能:

  • 普通上下拉刷新
  • 自动上下拉刷新
  • 上拉无更多数据控制
  • 上下拉百分比显示
  • 自定义上下拉动画

环境

  • Xcode 8.0+
  • Swift 3.0+
  • iOS 8.0+

如何导入

  • 1.手动导入
    把SwiftFCXRefresh文件夹导入即可
  • 2.使用CocoaPods
    
    platform :ios, '8.0'
    use_frameworks!

target ‘‘ do
pod ‘SwiftFCXRefresh’
end

## 如何使用
包含头文件
```objc
import SwiftFCXRefresh

下拉刷新

headerRefreshView = tableView.addFCXRefreshHeader { [weak self] (refreshHeader) in
    self?.refreshAction()
}

自动下拉刷新调用

headerRefreshView?.autoRefresh()

上拉加载更多

footerRefreshView = tableView.addFCXRefreshAutoFooter { [weak self] (refreshHeader) in
    self?.loadMoreAction()
}

自动上拉刷加载更多

footerRefreshView = tableView.addFCXRefreshAutoFooter { [weak self] (refreshHeader) in
    self?.loadMoreAction()
}

上下拉百分比显示

headerRefreshView?.pullingPercentHandler = { (percent) in
    headerPercentLabel.text = String.init(format: "%.2f%%", percent * 100)
}

footerRefreshView?.pullingPercentHandler = { (percent) in
    footererPercentLabel.text = String.init(format: "%.2f%%", percent * 100)
}

上下拉刷新、百分比链式调用

headerRefreshView = tableView.addFCXRefreshHeader { [weak self] (refreshHeader) in
    self?.refreshAction()
}.pullingPercentHandler(handler: { (percent) in
    //百分比
    print("current percent", percent)
})

footerRefreshView = tableView.addFCXRefreshFooter { [weak self] (refreshHeader) in
    self?.loadMoreAction()
}.pullingPercentHandler { (percent) in
    print("current percent", percent)
}

显示效果:

Latest podspec

{
    "name": "SwiftFCXRefresh",
    "version": "0.1.1",
    "summary": "Swiftu7248u4e0au4e0bu62c9u5237u65b0.",
    "description": "u63d0u4f9bu7b80u4fbfu7684u4e0au4e0bu62c9u5237u65b0uff0cu652fu6301u81eau5b9au4e49uff0cu53eau9700u7b80u5355u7684u4e24u4e09u884cu4ee3u7801u5373u53ef.",
    "homepage": "https://github.com/FCXPods/SwiftFCXRefresh",
    "license": "MIT",
    "authors": {
        "fengchuanxiang": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/FCXPods/SwiftFCXRefresh.git",
        "tag": "0.1.1"
    },
    "source_files": "SwiftFCXRefresh/",
    "resources": "SwiftFCXRefresh/*.png",
    "requires_arc": true,
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This