Skip to content

SteveBarnegren/SBGradientView

Repository files navigation

SBGradientView

Version License Platform

Convenient UIView wrapper around CAGradientLayer

How to use

let colors = [UIColor.red, UIColor.orange, UIColor.green, UIColor.blue]
let gradientView = GradientView(direction: .fromTop, colors: colors)

IMG

Four directions are supported:

public enum Direction {
        case fromTop
        case fromBottom
        case fromLeft
        case fromRight
    }

Installation

CocoaPods

pod "SBGradientView"

Manual

Copy GradientView.swift in to your project

Author

@SteveBarnegren

License

SBGradientView is available under the MIT license. See the LICENSE file for more info.