ios - 源文件swift中的编辑器占位符

标签 ios swift xcode compiler-errors

这个问题在这里已经有了答案:





Swift Editor Placeholder in source file

(3 个回答)


3年前关闭。




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
通过单击“这发生在我身上,请帮助我。谢谢”查看图像。

最佳答案

你需要这样写:

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

关于ios - 源文件swift中的编辑器占位符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53528323/

相关文章:

ios - 与协议(protocol)相关的 SourceKitService 崩溃?

iphone - 如何通过项目模板定义向 AppDelegate.m 添加方法

iphone - 清理 Localized.strings

ios - 带有 slider 和 iphone 按钮的 AVPlayer 音量控制

swift - Alamofire 导入失败

ios - 警告 - 尝试在 Swift 中显示 UIAlertController null

swift - 在 Swift 中重用闭包

xcode - 尝试构建用于发布的 XCode 项目时出现 Typedef 重定义错误

ios - 在 UIImageView iOS 后面添加 CAGradient 层

ios - 预加载CCAction?