My UICollectionView cells contain UILabels with multiline text. I don\'t know the height of the cells until the text has been set on the label.
-(CGSize)c
subclass UICollectionViewCell and override layoutSubviews like this
hereby you will anchor cell leading and trailing edge to collectionView
override func layoutSubviews() {
super.layoutSubviews()
self.frame = CGRectMake(0, self.frame.origin.y, self.superview!.frame.size.width, self.frame.size.height)
}