Last active
October 15, 2015 13:20
-
-
Save jamztang/68c3e16d071a01db81cf to your computer and use it in GitHub Desktop.
Fix UICollectionViewCell broken autolayout constraints in Xcode 6 GM + iOS 7.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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