GradientView in Swift/iOS

Bezaleel Ashefor
SiriusLabs
Published in
1 min readDec 19, 2017

Was building an event-based app recently and had a hard time figuring out Gradient based background views.

Part of the problem was never having heard of the CAGradientLayer(). Now that is out of the way, here is the complete fix to solving that, just in case someone else did fall into the same boat as me.

The CustomDarkUIView Class

Results

--

--

Bezaleel Ashefor
SiriusLabs

Creator. I am also an iOS/macOS engineer building Viso (https://getviso.app) and Litur (https://litur.app). Sometimes I moonlight as a full stack engineer