Type Safely

Type Safely

Use Multiple Shadows With .foregroundStyle

Daily Coding Tip 166

Millie Sturgeon's avatar
Millie Sturgeon
Sep 04, 2022
∙ Paid
person holding light bulb
Photo by Diego PH on Unsplash

It is possible to combine multiple shadows, because every type that conforms to ShapeStyle has this function provided by Apple:

extension ShapeStyle {
    public static func shadow(_ style: ShadowStyle) -> some ShapeStyle
}

In other words, any ShapeStyle can return a new ShapeStyle that has a shadow applied to it.

A shadow Sha…

User's avatar

Continue reading this post for free, courtesy of Type Safely.

Or purchase a paid subscription.
© 2026 Type Safely · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture