Swift:使用未声明的类型 [英] Swift: Use of undeclared type

查看:50
本文介绍了Swift:使用未声明的类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在实现一个类,但出现此错误:

I'm implementing a class but I'm getting this error:

使用未声明的类型myProtocol"

Use of undeclared type 'myProtocol'

这是我的代码:

class LocalContactService: myProtocol{

你们有谁知道我为什么会收到这个错误吗?

Any of you knows why I'm getting this error?

推荐答案

我遇到了同样的错误.在我的情况下,我意外地发现我在构建阶段"中将我的 swift 文件添加到复制包资源"中,我删除了所有 swift文件除外资产然后一切正常.

i had the same error .in my case i found accidentally that i added my swift files into "copy bundle resource" in "build phase" i removed all swift file except assets then everything worked fine.

这篇关于Swift:使用未声明的类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆