Auto Layout in UICollectionViewCell not working

Solution 1:

Well, I just looked on the iOS developer forums. Apparently, this is a bug with the iOS 8 SDK running on iOS 7 devices. The workaround is to add the following to your subclass of UICollectionViewCell:

- (void)setBounds:(CGRect)bounds {
    [super setBounds:bounds];
    self.contentView.frame = bounds;
}
override var bounds: CGRect {
    didSet {
      contentView.frame = bounds
    }
}

Solution 2:

Equivalent Swift Code :

override var bounds: CGRect {
    didSet {
      contentView.frame = bounds
    }
}