Member-only story

UITableViewCell with Round Corners and Shadows in Swift 5

Pavlos Simas
3 min readNov 13, 2021

--

This is a tutorial to add both Round Corners and shadow in UITableViewCell using swift 5.

You can find also the full tutorial in pdf in this link:

The best way to do that is to use 2 different layers for the corner radius and the shadows. Let’s start setting the shadow in a cell.

First we need to create an Extension of UIView in order to apply our shadow in every view.

We wrote the applyShadow function which takes a cornerRadius to set in the layer and the properties of the shadow. You can play the shadowColor, shadowRadiues and shadowOpacity to design your shadow as you wish.

Now let’s create a base UITableViewCell that we need for every cell we are creating in our app.

Using the code above we say at the cell to applyShadow with corner radius 8 in it’s root view. Now let’s create our…

--

--

Pavlos Simas
Pavlos Simas

Written by Pavlos Simas

iOS Developer, with passion about Development, Marketing and Finance. Join Medium from the following link: https://simaspavlos.medium.com/membership

Responses (4)

Write a response