Swift 4+ 的下拉刷新 (The refresh use Swift4)
最简单也是推荐的方式 The sample way.
pod 'FitRrefesh'
另外一种 else
You can also drop the Sources
to your project.
// header
// first way
self.tableView.fr.headerView = FRNormalHeader(target: self, action: #selector(NormalTableViewController.upPullLoadData))
self.tableView.fr.headerView?.beginRefreshing()
// second way
self.tableView.fr.headerView = FRNormalHeader(ComponentRefreshingClosure: {
self.upPullLoadData()
})
self.tableView.fr.headerView?.beginRefreshing()
// footer
// first way
self.tableView.fr.footerView = FRAutoNormalFooter(target: self, action: #selector(NormalTableViewController.downPullLoadData))
// second way
self.tableView.fr.footerView = FRAutoNormalFooter(ComponentRefreshingClosure: {
self.downPullLoadData()
})
// header
// first way
self.tableView.fr_headerView = FRNormalHeader(target: self, action: #selector(NormalTableViewController.upPullLoadData))
self.tableView.fr_headerView?.beginRefreshing()
// second way
self.tableView.fr_headerView = FRNormalHeader(ComponentRefreshingClosure: {
self.upPullLoadData()
})
self.tableView.fr_headerView?.beginRefreshing()
// footer
// first way
self.tableView.fr_footerView = FRAutoNormalFooter(target: self, action: #selector(NormalTableViewController.downPullLoadData))
// second way
self.tableView.fr_footerView = FRAutoNormalFooter(ComponentRefreshingClosure: {
self.downPullLoadData()
})