Efficient UIKit Shadows

Shadows have never been so much fun

Steven Curtis
7 min readApr 12, 2023
Photo by Martino Pietropoli on Unsplash

Before we start

Difficulty: Beginner | Easy | Normal | Challenging

This article has been developed using Xcode 12.2, and Swift 5.3

Prerequisites

Keywords and Terminology

Storyboard: A visual representation of the User Interface of an Application

UIView: An object that manages the content for a rectangular area on the screen

This article

Background

Oh shadows. You are likely to want to put shadows on `UIView` subclasses when you use UIKit, and it seems reasonably simple — A `UIView` has a layer and shadows can be applied programmatically using the following properties”

* shadowColor

* shadowOffset

* shadowOpacity

* shadowPath

* shadowRadius

which (as we shall see) can pretty simply create shadows.

--

--