So I Wanted To Draw A Gradient
Benjamin J. Dietzkis
1.2K9

Composition over inheritance

public extension CAGradientLayer {
 func set(_ gradientType: GradientType) {
 self.startPoint = gradientType.start
 self.endPoint = gradientType.end
 }
}

gradient.set(GradientPoint.topBottom.gradientType)