The Only CAGradientLayer Guide You Will Ever Need

An App to help you? Why not?

Photo by JD Chow on Unsplash

Prerequisites:

Terminology:

The App

gradient.colors = colours.map{ $0.cgColor }
let animation = CABasicAnimation(keyPath: "endPoint")animation.fromValue = gradient.endPointanimation.toValue = endPoint.pointanimation.duration = 5.0self.gradient.endPoint = endPoint.pointself.gradient.add(animation, forKey:"animateendpoint")

location (which is linked to colour)

startPoint and endPoint

Type

Tips to recreate the App

Conclusion

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store