1
votes

Size classes are phenomenal for specific constraints between devices. However you can't add constraints directly to a UITableViewCell or a UICollectionViewCell - specifically height and width.

I want to have a larger UICollectionViewCell on iPad Size Classes than iPhone so I always have three cells per row in portrait mode regardless of device. However, because I can't add constraints to the Cell, and adjusting the height/width directly is independent of size classes, I'm at a bit of a loss.

1
i have same problem ....if you solved this one than plz share with me....thank youBandish Dave

1 Answers

1
votes

UIViewControllers conform to UIContentContainer protocol, so you you will be told whenever controller view's size is changing by overriding -viewWillTransitionToSize:withTransitionCoordinator: (this new iOS 8 API is also called on rotations) changing your UICollectionViewFlowLayout itemSize (which is responsible for cells size).