The story starts from here, today I was looking into the old codebase and found a bunch of lines of code for calculating the width of `UICollectionViewCell` then I realized is it really required and after Googling I found lots of people are writing code again.
In my scenario, it was breadcrumbs where I needed dynamic width so I removed whole code and here is what I did.
STEP: 1 Added `UILabel` with four constraints.
STEP: 2 Created `UICollectionViewFlowLayout` using `UICollectionView` reference and set the estimated `CGSize`
STEP: 3 set cell `UILabel` to `sizeToFit()`
Thank you if you want to look into codebase, follow this GIT Link.