https://github.com/keepworks/kwgradientview
Subclass of UIView to add gradients to your views and animate them by changing colors
https://github.com/keepworks/kwgradientview
animated-gradient animation diagonal gradient horizontal storyboard swift vertical
Last synced: 8 months ago
JSON representation
Subclass of UIView to add gradients to your views and animate them by changing colors
- Host: GitHub
- URL: https://github.com/keepworks/kwgradientview
- Owner: keepworks
- License: mit
- Created: 2016-12-09T07:04:26.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-09-20T06:14:51.000Z (over 6 years ago)
- Last Synced: 2025-08-03T22:36:16.092Z (10 months ago)
- Topics: animated-gradient, animation, diagonal, gradient, horizontal, storyboard, swift, vertical
- Language: Swift
- Homepage:
- Size: 3.93 MB
- Stars: 12
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KWGradientView

[](https://www.bitrise.io/app/d54da2ec7c9a0496)
[](http://cocoapods.org/pods/KWGradientView)
[](http://cocoapods.org/pods/KWGradientView)
[](http://cocoapods.org/pods/KWGradientView)
## Features
- [x] Horizontal, vertical & diagonal gradients
- [x] Animate gradients by changing colors
## Requirements
- iOS 10.0 or later
- Swift 5
## Installation
KWGradientView is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "KWGradientView"
```
## How to use
#### Add the class KWGradientView to View on storyboard

#### Modifying color and gradient style using storyboard

#### Or Modify Programmatically: Example with Horizontal Gradient
```swift
@IBOutlet weak var gradientView: KWGradientView!
gradientView.addGradientLayerAlongXAxis(colors: [UIColor.red, UIColor.green, UIColor.blue])
```
Also we can add any number of colors by adding them to the array of colors.
All the methods in the pod are implemented in [`GradientsViewController.swift`](https://github.com/keepworks/KWGradientView/blob/master/KWGradientView/GradientsViewController.swift) for your reference.
## Author
KeepWorks, ios@keepworks.com
## Credits
KWGradientView is owned and maintained by [KeepWorks](http://www.keepworks.com/).
[](http://www.keepworks.com/)
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/keepworks/KWGradientView.
## License
KWGradientView is available under the [MIT License](http://opensource.org/licenses/MIT). See the [License](https://github.com/keepworks/KWGradientView/blob/master/LICENSE) file for more info.