GradientView
界面构建器或代码中轻松使用渐变。
安装
使用CocoaPods。
pod 'GradientViewInspectable'
使用方法
在代码中
let view = GradientView(frame: CGRect(x: 0, y: 50, width: 50))
view.startColor = .blue
view.startColor = viewColor.topColor
view.endColor = viewColor.bottomColor
在界面构建器中
Change view class to GradientView and you are good to go.