SJLineRefresh 是一个使用 Swift5 编写的易于自定义形状的 pull-to-refresh 库。
- 这是什么?
这是一个易于自定义形状的 pull-to-refresh 控件 中文介绍
- 如何使用
let aPath = Bundle.main.path(forResource: "HHMedic", ofType: "plist")!
let aConfig = SJRefreshConfig(plist: aPath)
tableView.sj_header = SJRefreshView(config: aConfig) { [weak self] in
// do your refresh
}
- 如何创建形状
目前仅支持线条形状。
PaintCode 是一个将绘图转换为 Objective-C 或 Swift 代码的应用程序。
- drawing lines whatever you want;
- paste the points that PaintCode genarated into your own plist(startPoints, endPoint);
- the refreshView's maxWidth is equal to the max x of points in step 2. so does the maxHeight.
- 安装
CocoaPods
CocoaPods 是一个用于 Cocoa 项目的依赖管理器。
$ gem install cocoapods
要使用 CocoaPods 将 Alamofire 集成到您的 Xcode 项目中,请在您的 Podfile 中指定它
pod 'SJLineRefresh', '~> 1.1.1'
然后,运行以下命令
$ pod install
Carthage
Carthage 是一个集中式的依赖管理器,它构建您的依赖并提供二进制框架。您可以使用以下命令使用 Homebrew 安装 Carthage
$ brew update
$ brew install carthage
要使用 Carthage 将 Alamofire 集成到您的 Xcode 项目中,请在您的 Cartfile 中指定它
github "515783034/SJLIineRefresh" ~> 1.1.1
运行 carthage update
来构建框架并将构建的 SJLineRefresh.framework 拖放到您的 Xcode 项目中。
- 参考