79450946

Date: 2025-02-19 10:16:31
Score: 1
Natty:
Report link

For iOS 16+

There’s a new native modifier for creating inner shadows, which can even be used on strokes like this:

    var body: some View {
        Circle()
            .stroke(.white.shadow(.inner(color: .gray, radius: 10, x: 2, y: 2)),
                    lineWidth: 50)
            .frame(width: 300, height: 300)
    }

The result might look like this: Final image of the inner shadow used on a shape with stroke

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Hollycene