WooKoo Blog

물과 같이

개발/개발

Swift - CollectionView LayOut

WooKoo 2020. 9. 13. 21:42
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
        
        let collectionViewCellWithd = collectionView.frame.width / 3 - 1
        
        return CGSize(width: collectionViewCellWithd, height: collectionViewCellWithd)
        
    }
    //윗라인
        func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {

            return 1

        }

        //옆 라인 간격

        func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {

            return 1

        }