I am trying to recreate a button like this in Swift:
I have been able to create the gradient inside of the button accurately from Sketch using the help from here: Answered Question
Now I am trying to recreate the glow effect behind the button. I was thinking creating a subview behind it and using a gaussian blur filter to draw it. Now I am stuck in how to implement this, and haven't found a good solution. The normal CALayer shadow doesn't work with gradients, and I am lost. Any help is appreciated
You can do it like this
Init your gradient layer
Set preferable size for example 40 from button's frame
Init shadow layer
Set the shadow layer as a mask for gradient layer
Insert gradient layer in button's superView below button's layer