TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Oct 2016 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by xiabob.
下拉刷新控件,纯swift框架,inspired by ODRefreshControl
将Class目录下的XBRefreshControl.swift、XBScrollViewExtension.swift导入到工程即可
具体使用参看demo工程
let refresh = XBRefreshControl(activityIndicatorView: UIActivityIndicatorView(activityIndicatorStyle: .Gray), delegate: nil, refreshAction: nil) tableView.xb_refreshHeader = refresh refresh.addTarget(self, action: #selector(dropViewDidBeginRefreshing), forControlEvents: .ValueChanged)
let refresh = XBRefreshControl { [unowned self](refreshControl) in self.dropViewDidBeginRefreshing(refreshControl) } tableView.xb_refreshHeader = refresh
let refresh = XBRefreshControl(delegate: self) tableView.xb_refreshHeader = refresh //XBRefreshControlDelegate func onRefresh(refreshControl: XBRefreshControl) { dropViewDidBeginRefreshing(refreshControl) }