Travis Kirton

Shadow Path

By default, a view’s shadow inherits a path that outlines its content. However, you can change the path of a shadow like this:

view.shadow.path = shape.path

Typically, you will create a shape object and use its path.


let c = Circle(center:, radius: 100)
c.shadow.opacity = 0.4
c.shadow.radius = 3.0
c.shadow.offset = Size(130, 130)

let s = Star(center: Point(), pointCount: 40, innerRadius: 99, outerRadius: 105)
c.shadow.path = s.path