This happened to me please help me please,Thank you.
此处的代码:
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "MenuCollectionViewCell", for: IndexPath) as! MenuCollectionViewCell
return cell
}
image here 点击“发生在我身上的图像,请帮助我。谢谢。”
答案 0 :(得分:-1)
您需要这样写:
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "MenuCollectionViewCell", for: indexPath) as! MenuCollectionViewCell
return cell
}