Creating a Collapsible UITableViewCell in Swift: A Step-by-Step Guide

Appear that section!

Steven Curtis
6 min readJan 24, 2024
Photo by and machines on Unsplash

Difficulty: Beginner | Easy | Normal | Challenging

This article has been developed using Xcode 15.0, and Swift 5.9

The background to this is I wanted to make an email from a SwiftUI App. I mean how hard can that be?

Prerequisites:

You need to be able to code in Swift, using UIKit.

The Project

I’ve been thinking about creating a social media style application.

It’s a rather basic UITableView with requisite UITableViewCell instances. When you click on the cell the like count is incremented. Something like the following

Which should be pretty easy.

No data

There is no backend for this. So what I’m going to do is make some CellData.

struct CellData {
var count…

--

--