Below attached image is representing my requirement:
In this image the yellow color UITableView will have list of different UITableViewCell items. In one of the UITableViewCell it has UICollectionView with its list of UICollectionViewCell items and the scroll direction for the UICollectionView is set to horizontal
Each UICollectionViewCell will have one UITableView (Highlighted in Red Color) and it will have its list of UITableViewCell (Highlited in Rose Color) items. Here, the UITableViewCell (Highlited in Rose Color) item can collapse/expand. Whenever the cell is collapse/expand the red table's content size is handled automatically. But, whenever the red table's content size is increased the collectionview size is not increasing.
I have added all relevant constraints to these UI elements. But, the content size or frame of the collectionview is not expanding when a tableview cell is expanded.
To understand better here i am breaking it down how the views are designed:
- Yellow tableview embedded inside a
UIViewControllerand it will have one simpleUITableViewCellwhich has no custom class - To the cell programatically the
UICollectionViewwill be added. ThisUICollectionViewis placed in onexibfile and it has embeded inside aUIView UICollectionViewCellhas been created in onexiband it will haveUITableViewelement inside.- Also,
UITableViewCellhas its ownxibto refer and this is the cell which will gets expand/collapse
I have tried modifying the intrinsicContentSize property to modify the UICollectionView property's height where it has embedded inside UIView element whenever the expand is happening. Please, refer the CardView.swift for the reference.
I know the design is bit complex. But, what am i missing here?

