Skip to main content

One post tagged with "Shadow"

UIView shadow effects and styling

View All Tags

How to add a shadow to a UIView in Swift | Source Code Example | iOS

· 2 min read
Full Stack Developer
Last updated on August 11, 2021

iOS has built-in support for adding shadows to UIView components. All you need to do in order to add a shadow to a UIView object is to set the shadow properties of the view’s layer. Shadows are a powerful user interface design element, making the visual components stand out by giving them a 3D look and feel. In order to display a shadow in Swift, iOS allows you to specify its color, opacity, offset and radius. Our recommendation is to try out different values for these variables, to see for yourself what are they exactly.