Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift: Use of undeclared type

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

Use of undeclared type 'myProtocol'

Here is my code:

class LocalContactService: myProtocol{

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

like image 939
user2924482 Avatar asked Dec 03 '22 14:12

user2924482


2 Answers

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.

enter image description here

like image 121
Hamed Nova Avatar answered Dec 22 '22 23:12

Hamed Nova


the issue is caused when the classes in question do not belong to the same targets, usually the test target is missing. Just make sure the following check boxes are ticked. you can refer to original answer: https://stackoverflow.com/a/30737191/3992606

enter image description here

like image 34
mohsen Avatar answered Dec 22 '22 23:12

mohsen