var header: MJRefreshNormalHeader!
var footer: MJRefreshAutoNormalFooter!
var currentIndex: Int = 1
var set: [Expert] = []
func setMJRefresh(){
footer = MJRefreshAutoNormalFooter(refreshingBlock: {
self.getEmployeeList()
})
footer.setTitle("", for: MJRefreshState.idle)
header = MJRefreshNormalHeader {
self.currentIndex = 1
self.getEmployeeList()
self.footer.resetNoMoreData()
}
tableView.mj_header = header
tableView.mj_footer = footer
header.beginRefreshing()
}
func stopRefresh(count: Int){
if count < 10{
self.footer.endRefreshingWithNoMoreData()
}else{
self.currentIndex += 1
self.footer.endRefreshing()
}
self.header.endRefreshing()
footer.setTitle(set.count == 0 ? " " : "已加载全部数据~", for: MJRefreshState.noMoreData)
self.tableView.reloadData()
}
网友评论