It's relatively easy to animate the path of a CAShapeLayer
.
( Great article on that: https://stackoverflow.com/a/36461202/294884 )
let shapeLayer = CAShapeLayer()
shapeLayer.path = .. some bezier
... CABasicAnimation(keyPath: "path")
But is it actually possible to animate layer.mask in a UIView?
Recall that
The actual layer.mask of a UIView will actually mask subviews of the UIView.
a CAShapeLayer with a path does not mask subviews of the UIView; it just masks itself and creates a pretty picture there on that view.
Can you animate a UIView's .layer.mask ?