I am using the GradientButton class in my application. When I change the frame of a button the CAGradientLayer doesn’t change for the new frame. The CAGradientLayer is the size of the old frame dimensions which makes the button look really poor. The added width or height then is just a solid color and doesn’t have the Gradient. One solution would be to delete the button and re-add it, however this is not the path I want to take. Is there a method that I can call to redraw the GradientButton so that the gradient layer encompasses the new button dimensions?
Update: removeFromSuperview and addSubview doesn’t fix issue.
Created this method to solve problem: