Use collectionView's delegate for setting size to cell,
Objective-C
- (CGSize)collectionView:(UICollectionView *)collectionView
layout:(UICollectionViewLayout*)collectionViewLayout
sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"SETTING SIZE FOR ITEM AT INDEX %d", indexPath.row);
//Calculate the height required for tableView inside the cell and set it to the cell
return CGSizeMake(80, 80);
}
Swift
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
NSLog(@"SETTING SIZE FOR ITEM AT INDEX %d", indexPath.row);
//Calculate the height required for tableView inside the cell and set it to the cell
return CGSizeMake(80, 80);
}
Hope it helps you.