If I understood correctly:
- your main body liquid view and the wave view are added as subviews to container view.
- you have added a mask to that container view (liquidContainer)
- then you have added the liquidContainer to another main view where you have the cup as subview as well

If that's the case, you could trying adding a CAGradientLayer
to the layer of the container view as sublayer:
let gradient = CAGradientLayer()
gradient.startPoint = someStartPoint
gradient.endPoint = someEndPoint
gradient.frame = someFrame
gradient.colors = someColorsArray //note that it uses CGColor if you use UIColor it won't work
liquidContainerView.layer.addSublayer(gradient)
If I misunderstood your view hierarchy, why not try to reproduce this hierarchy in your setup and see if it works.