DTGradientButton
Easy way to set gradient background to your buttons.
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Usage
To set gradient colors as background for a button, just use it as below:
Method setGradientBackgroundColors(_ colors:, direction:, for state:)
is provided as an extended method of UIButton. For that reason, you can use it for any UIButton instance in your project.
Eight predefined directions are supported for the gradient.
Besides setting gradient background for UIButton, you can take advantage of this library to create gradient image as below:
Requirements
iOS 8.0
Installation
DTGradientButton is available through CocoaPods. To install
it, simply add the following line to your Podfile: