https://github.com/stevebarnegren/sbgradientview
Convenient UIView wrapper for CAGradientLayer
https://github.com/stevebarnegren/sbgradientview
Last synced: 9 days ago
JSON representation
Convenient UIView wrapper for CAGradientLayer
- Host: GitHub
- URL: https://github.com/stevebarnegren/sbgradientview
- Owner: SteveBarnegren
- License: mit
- Created: 2016-10-25T14:43:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-15T11:05:57.000Z (over 7 years ago)
- Last Synced: 2025-06-04T02:58:14.849Z (28 days ago)
- Language: Swift
- Size: 86.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SBGradientView
[](http://cocoapods.org/pods/SBGradientView)
[](http://cocoapods.org/pods/SBGradientView)
[](http://cocoapods.org/pods/SBGradientView)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)
```
Four directions are supported:
```
public enum Direction {
case fromTop
case fromBottom
case fromLeft
case fromRight
}
```## Installation
**CocoaPods**
```ruby
pod "SBGradientView"
```**Manual**
Copy ```GradientView.swift``` in to your project
## Author
[@SteveBarnegren](https://twitter.com/stevebarnegren)
## License
SBGradientView is available under the MIT license. See the LICENSE file for more info.