I have a PopupView with a scrollable label (like Marquee type). Its scrolled inside a labelView, which is just a UIView.
I decided to add an effect of transparent gradient to the left and right sides of labelView using the following code:
let gradientLayer = CAGradientLayer()
gradientLayer.startPoint = CGPoint(x: 0, y: 0)
gradientLayer.endPoint = CGPoint(x: 0.5, y: 0)
gradientLayer.colors = [UIColor.clear.cgColor, UIColor.white.cgColor, UIColor.white.cgColor]
gradientLayer.locations = [0, 0.2, 1]
gradientLayer.frame = labelView.bounds
labelView.layer.mask = gradientLayer
But the effect is visible only on the left side of the labelView. Right side is unchanged:
How can I apply the same gradient to the labelView right side?
