快速编辑源文件中的占位符

时间:2018-11-28 21:22:43

标签: ios swift xcode compiler-errors

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 点击“发生在我身上的图像,请帮助我。谢谢。”

1 个答案:

答案 0 :(得分:-1)

您需要这样写:

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
    let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "MenuCollectionViewCell", for: indexPath) as! MenuCollectionViewCell
    return cell
}