Convenient UIView wrapper around CAGradientLayer
let colors = [UIColor.red, UIColor.orange, UIColor.green, UIColor.blue]
let gradientView = GradientView(direction: .fromTop, colors: colors)
Four directions are supported:
public enum Direction {
case fromTop
case fromBottom
case fromLeft
case fromRight
}
CocoaPods
pod "SBGradientView"
Manual
Copy GradientView.swift
in to your project
SBGradientView is available under the MIT license. See the LICENSE file for more info.