埋め込む
class MyViewController: UIViewController, UICollectionViewDataSource , UICollectionViewDelegate , UICollectionViewFlowLayout
のViewDidLoad
collectionView.delegate = self;
collectionView.datasource = self;
フロー レイアウトのデリゲートを追加
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
if indexPath.row == 0 || indexPath.row == 1 || indexPath.row == 2{
return CGSize(self.view.frame.size.width / 3, 100)
}
else{
return CGSize(self.view.frame.size.width / 2, 100)
}
// return the size you what
}