Skip to content

SwiftUI: Shadow

Shadow could definitely bring your design to a next level. Be sure to include them in your design.

Adds a shadow to the view.

Apple Documentation

In this tutorial, you’ll learn what is Shadow in SwiftUI. You’ll learn:

  • How to use Shadow.

Prerequisites

To follow along this tutorial, you’ll need some basic knowledge in:

  • A basic familiarity with Swift.
  • At least Xcode 11

Shadow

Including shadow and corner radius is a big mess in UIKit where you’ll need to create two view to achieve that. Below is just an example of including both corner radius and shadow.

You could even adjust the radius of the shadow.

If the shadow color doesn’t suit your design. Then you can even opt to pick your own color.

You can even move the shadow around by playing around with the x and y axis.

Where to go From Here

If you feel like you are ready to take on more challenges, feel free to check out some other tutorials that we have created:

Published inSwiftUI

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *