当前位置: 代码迷 >> 综合 >> type 'simple Class' does not conform to protocol 'Example Protocol'错误
  详细解决方案

type 'simple Class' does not conform to protocol 'Example Protocol'错误

热度:56   发布时间:2023-12-11 14:10:37.0

在看swift教程中“接口和扩展”这小部分。在编写时提示“type 'simple Class' does not conform to protocol 'Example Protocol'”的错误,原因是simpleClass没有完全实现protocol中定义的方法。检查了下代码,原来是自己把方法名给写错了。

mutating 只针对 struct 和 enum  。

  相关解决方案