I've make a path in order to mask my view:

```
let path = // create magic path (uiview bounds + 2 arcs)
let mask = CAShapeLayer()
mask.path = path.cgPath
view.layer.masksToBounds = false
view.layer.mask = mask

```

Up to here all ok.

Now I would like to add a shadow that follows path, is it possibile?

I try in several way, the last one is: 

```
mask.shadowPath = path.cgPath
mask.shadowColor = UIColor.red.cgColor
mask.shadowOffset = CGSize(width: 10, height: 2.0)       
mask.shadowOpacity = 0.5

```

But this produce a partial shadow and with color of the original view..

[![enter image description here](https://i.stack.imgur.com/kCz1T.png)](https://i.stack.imgur.com/kCz1T.png)

With debug view hierarchy:

[![enter image description here](https://i.stack.imgur.com/wOpWQ.png)](https://i.stack.imgur.com/wOpWQ.png)

Any advice?

Final result should be similar to this, but with shadow that "follows" arcs on path.

[![enter image description here](https://i.stack.imgur.com/3KmGO.png)](https://i.stack.imgur.com/3KmGO.png)