-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Hi,
I am trying to incorporate this code into my project and I am having trouble changing the colors so that it's not always grey and orange. Is it possible to edit this code anywhere so it'll accept variables for the colors:
//MARK: Private Methods
private lazy var gradient: CAGradientLayer = {
let gradientLayer = CAGradientLayer()
gradientLayer.colors = [UIColor.darkGray.cgColor, UIColor.orange.cgColor]
gradientLayer.startPoint = CGPoint(x: 0, y: 0)
gradientLayer.endPoint = CGPoint(x: 1, y: 1)
gradientLayer.frame = self.bounds
return gradientLayer
}()
How do I call this from my controller with variable colors?
Metadata
Metadata
Assignees
Labels
No labels