extension ViewAllViewC : UICollectionViewDelegateFlowLayout{
 
 func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
 return UIEdgeInsets(top: 2, left: 0, bottom: 2, right: 0)
 }
 
 func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
 let collectionViewWidth = collectionView.bounds.width
 return CGSize(width: collectionViewWidth/3 - 2, height: collectionViewWidth/3)
 }
 
 func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
 return 2
 }
 func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
 return 2
 }
}


Screen Shot 2018-02-17 at 2.48.28 PM
Advertisements