- Open below directory in Finder with Cmnd + Shift + G
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/
| class AwesomeViewController: UICollectionViewController { | |
| func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize | |
| { | |
| let cellSpacing = CGFloat(1) //Define the space between each cell | |
| let leftRightMargin = CGFloat(0) //If defined in Interface Builder for "Section Insets" | |
| let numColumns = CGFloat(3) //The total number of columns you want | |
| let totalCellSpace = cellSpacing * (numColumns - 1) | |
| let screenWidth = UIScreen.mainScreen().bounds.width // Get the width of the screen. |