Contact class not visible to ContactsViewController.m

Hey peeps, bit of a newb here so be nice :slight_smile:

Not sure if anyone else is having or has had the same issue but in Listing 28.7, my Contact class (Swift file) is not accessible in ContactsViewController.m - even after importing the Contacts-Swift.h header file.

When trying to create an instance of Contact in the Objective-C file, I get the error message “Use of undeclared identifier ‘Contact’.”

I’m pretty certain I’ve followed the book without any mistakes and downloaded the final solution where instances of Contact have been created without any errors so I don’t understand why I can’t create these instances.

Any help would be much appreciated, cheers.

Hi there, I’m having the exact same issue. I don’t believe we made any mistake since I have also checked my code with the book’s.

Hi Husain, the code in the book is correct I just had to close the project then quit Xcode then reopen the project to get it to work.

Hopefully that’ll do it :slight_smile:

You’re right, it works now! Thank you very much.