I am trying to add a gradient layer to my view, first time when I run the code it inserts the layer perfectly but every 10 sec I run the same function again to change the layer but it doesn't update the layer. I am trying to add a gradient layer to my view,