How to add a shadow to a UIView in Swift | Source Code Example | iOS
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.