I\'m trying to pin an UILabel to it\'s parent cell. I added four constraints (top, leading, trailing, bottom) which works fine on iOS 8.0 but not on iOS 7.X
The problem is that your custom view (UILabel) has constraints, which conflict with cell's (or better cell's contentView's) constraints. The cell's NSAutoresizingMaskLayoutConstraint are created automatically from what you set in UICollectionView properties in xib (or storyboard) as Cell Size. I have solved my similar problem (*) by explicitly setting
- (void)awakeFromNib {
[super awakeFromNib];
self.contentView.translatesAutoresizingMaskIntoConstraints = NO;
}
in my custom UICollectionViewCell subclass. This gets rid of cell size constraint set in Storyboard.
(*) Disclaimer: My collectionView has self sizing cells based on their content view, which is defined by autolayout. I had warnings about conflicting constraints of my content autolayout, and explicit size in Storyboard. This helped me to get rid of those warnings.