Skip to content

Instantly share code, notes, and snippets.

@jamztang
Last active October 15, 2015 13:20
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamztang/68c3e16d071a01db81cf to your computer and use it in GitHub Desktop.
Save jamztang/68c3e16d071a01db81cf to your computer and use it in GitHub Desktop.
Fix UICollectionViewCell broken autolayout constraints in Xcode 6 GM + iOS 7.1
//
// Created by James Tang @jamztang
// https://gist.github.com/jamztang/68c3e16d071a01db81cf
//
// Credit goes to https://stackoverflow.com/questions/25753373/ios-8-gm-does-not-update-constraints-on-collection-views/25768375#25768375
//
import UIKit
class BaseCollectionViewCell: UICollectionViewCell {
override var bounds : CGRect {
didSet {
// Fix autolayout constraints broken in Xcode 6 GM + iOS 7.1
self.contentView.frame = bounds
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment