UiCollectionView in UITableViewCell


I'm trying, with no success yet, to add a UiCollectionView to a static UITableViewCell and have it resize the tableViewCell vertically as the numbers of items in the collection grows. Is this even possible or is there a better solution to this problem?

Add height constraint in collectionview through storyboard and declare an iboutlet of class NSLayoutconstraint in tablecell for that constraint. In your tableview cell data configuration code change the constant value of that property to collectionview's contentsize.height. This will force the collectionview to increase its height which interns will force the cell to increase its height.