Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift - Use of unresolved identifier (Objective-C class)

So I was going to start moving my app over to swift (since it just seems so much easier to work with), and I figured Id be able to do a little at a time since you're supposed to be able to use it with existing objective-c code.

The problem Im having is it seems the interoperability doesn't seem to be working for some reason.

  • I have a MODULE_NAME-Bridging-Header.h file and the import statements: Bridging Header File

  • I have it specified under Build Settings > Swift Compiler > Objective-C Bridging Header Build Settings

That's all that needs to be done to make it work right? Thats all Ive been able to find online at least.

Here is the error Im getting: Error

Any help would be appreciated.

like image 506
Brian Tacker Avatar asked Mar 16 '23 17:03

Brian Tacker


1 Answers

You need to provide the whole file path from the root folder, not just the file name.

under Build Settings > Swift Compiler > Objective-C Bridging Header put:

MobileScripts/MobileScripts-Bridging-Header.h

like image 124
Allanah Fowler Avatar answered Mar 18 '23 06:03

Allanah Fowler