Dorian Roy
Dorian Roy

Reputation: 3104

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

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

Upvotes: 8

Views: 4518

Answers (1)

Mike Taverne
Mike Taverne

Reputation: 9362

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

Upvotes: 6

Related Questions