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

来源:互联网 发布:淘宝网商品销售方式 编辑:程序博客网 时间:2024/05/16 02:09

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

mutating 只针对 struct 和 enum  。

0 0
原创粉丝点击