0
特定のタスクを実行するために、コレクションビューセルが選択されている部分をどのように処理すればよいですか?ここで私のコードですが、動作していません、助けてください。1つのコントローラ内の2つのコレクションビューセル
func collectionView(collectionView: UICollectionView!, didSelectItemAtIndexPath indexPath: NSIndexPath) {
if let cell = latestNewsCollectionView.cellForItemAtIndexPath(indexPath){
print("latest selected")
}
if let cell = promotionCollectionView.cellForItemAtIndexPath(indexPath){
print("promotion selected")
}
私が手出力は次のようになります。最後に
latest selected
promotion selected
すべてのコレクションビューのセルが選択され、どのように私はこの問題を解決することができますか?
あなたは約2 'collectionViewCell'を取った後、2' collectionView'を比較していますか? –