概览
Degree 是一个用于在Swift中创建渐变的工具。
如何开始
- 将
Source文件夹的内容复制到您的项目中。
或者
- 使用
DegreeCocoapod
需求
- iOS 9以及以后的版本
- Xcode 9以及以后的版本
- Swift 4
使用方法
使用示例
let gradientView = GradientView()
gradientView.gradient = Gradient.make
.from(
x: .left,
y: .top
)
.to(
x: .right,
y: .bottom
)
.step(withColor: .white, andLocation: 0.0)
.step(withColor: .orange, andLocation: 0.5)
.step(withColor: .purple, andLocation: 1.0)
.get每个步骤都由其颜色和位置定义,位置是一个从0.0到1.0的Float值。
许可证
度(Degree) 可在 MIT 许可证下使用。有关更多信息,请参阅 LICENSE 文件。

