-
ios-swift写的一款简介易用的刷新框架,支持水平刷新.zip下载
资源介绍
SYRefresh
首先感谢你的支持,SYRefresh 是一款简洁易用的刷新控件,支持scrolview,Tableview,collectionview刷新功能,具备灵活的扩展功能。
使用方法:
直接将这个文件夹解压 拖入你的工程中,示例代码如下:
//添加头部刷新控件
scrollview:
scrollview.sy_header = TextHeader(normalText: "12", pullingText: "222", refreshingText: "333", orientation: .top, height: 60, font: UIFont.systemFont(ofSize: 14), color: UIColor.black, completion: { [weak self] in
DispatchQueue.main.asyncAfter(deadline: .now() 1) {
self?.scrollview.sy_header?.endRefreshing()
}
})
tableView:
tableView.sy_header = TextHeader(normalText: "12", pullingText: "222", refreshingText: "333", orientation: .top, height: 60, font: UIFont.systemFont(ofSize: 14), color: UIColor.black, completion: { [weak self] in
DispatchQueue.main.asyncAfter(deadline: .now() 1) {
self?.tableView.sy_header?.endRefreshing()
}
})
//添加尾部刷新控件
scrollview:
scrollview.sy_footer = TextHeader(normalText: "12", pullingText: "222", refreshingText: "333", orientation: .bottom, height: 60, font: UIFont.systemFont(ofSize: 14), color: UIColor.black, completion: { [weak self] in
DispatchQueue.main.asyncAfter(deadline: .now() 1) {
self?.scrollview.sy_footer?.endRefreshing()
}
})
tableView:
tableView.sy_footer = TextHeader(normalText: "12", pullingText: "222", refreshingText: "333", orientation: .bottom, height: 60, font: UIFont.systemFont(ofSize: 14), color: UIColor.black, completion: { [weak self] in
DispatchQueue.main.asyncAfter(deadline: .now() 1) {
self?.tableView.sy_footer?.endRefreshing()
}
})
更详细的使用方法可以进入这里查看:https://github.com/shushaoyong/SYRefreshForSwift