This project demonstrates expanding and collapsing UITableView
cells. There are many approaches to this but using a UIStackView
is currently (Xcode 10, Swift 5) the one that best handles cells with unique heights and supports auto layout. There are so many details to get right that I collected them in this simple project, rather than searching Stack Overflow each time I implement. Details like pinning the UIStackView
to the cell’s contentView
, setting tableView.rowHeight = UITableView.automaticDimension
, setting variable line height UILabel
s Content Compression Resistance Priority
, etc. are easy to overlook and may not manifest issues till runtime.
-
Notifications
You must be signed in to change notification settings - Fork 1
A simple example of using UIStackView to expand and collapse variable sized UITableViewCells with auto layout.
License
NormanBitSolace/ExpandableCells
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A simple example of using UIStackView to expand and collapse variable sized UITableViewCells with auto layout.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published