Gradient View
Easily use gradients in UIKit. Gradient View is a simple UIView wrapper around CGGradient.

Usage
let gradientView = GradientView(frame: CGRect(x: 20, y: 20, width: 280, height: 280))
gradientView.colors = [.green, .yellow]
gradientView.locations = [0.8, 1.0]
gradientView.direction = .horizontal
gradientView.topBorderColor = .red
gradientView.bottomBorderColor = .blue
view.addSubview(gradientView)
See the source for full documentation.
Example

Open up the included Xcode project for an example app.
Installation
Gradient View supports installation with Carthage or CocoaPods. You can also simply add GradientView.swift to your project if you’d prefer.