Skip to content

Instantly share code, notes, and snippets.

@andatta
Created September 2, 2016 14:56
Show Gist options
  • Save andatta/5e72020cad10a8120eb2f9196a1ee997 to your computer and use it in GitHub Desktop.
Save andatta/5e72020cad10a8120eb2f9196a1ee997 to your computer and use it in GitHub Desktop.
/*The trick is to adopt the protocol UICollectionViewDelegateFlowLayout
and implement the following method*/
//UICollectionViewDelegateFlowLayout method
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,
sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize{
//specify height as per your requirement
return CGSize(width: collectionView.bounds.width, height: 120)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment