Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "Use of undeclared type" in Xcode won't go away

I moved a Swift class declaration from one file to another and now Xcode 8.2.1 keeps nagging me with red errors "Use of undeclared type" wherever I use this class. The project does compile & run without errors, but when I edit the code the error messages pop up again.

I already

  • cleaned the project
  • cleaned the build folder
  • deleted DerivedData manually
  • restarted Xcode
  • restarted my Mac

Is there anything else I can do to get rid of these messages?

like image 423
Dorian Roy Avatar asked Jan 03 '17 14:01

Dorian Roy


1 Answers

The solution is to include the new file that you moved your class to in your test target.

like image 136
Mike Taverne Avatar answered Oct 14 '22 18:10

Mike Taverne