let gradientView = LDOGradientView()
gradientView.rotation = CGFloat(45)
gradientView.startColor = .red
gradientView.endColor = .yellow
gradientView.startOffset = 0.2
gradientView.endOffset = 0.5
While easy to use from code, you'll probably want to configure it in Interface Builder.
While LDOGradientView
uses IBInspectable
it does not support IB_DESIGNABLE
, because it seems that Interface Builder still struggles rendering those views properly.
To run the example project, clone the repo, and run pod install
from the Example directory first.
LDOGradientView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'LDOGradientView'
Raschke & Ludwig GbR, https://www.lurado.com/
LDOGradientView is available under the MIT license. See the LICENSE file for more information.