File not found error in bridging header file

2.3k Views Asked by At

I have an objective-c project. It is about two years that I am working on it. Now I want to do new works with Swift.

I added a new Swift class. Xcode asked me to add BridggingHeader file and I pressed YES.

but now in the bridging header file I want to import my current objective-c classed but this file do not recongize my objective-c files.

For example when I write:

#import "MYBaseViewController.h"

xcode shows error and says:

MYBaseViewController.h file not found
1

There are 1 best solutions below

7
On
  1. Check that bridging header is set correctly for each target by going to Build Settings.
  2. Make sure that the file is included in both targets. Select it in the Project Navigator and then open File Inspector and check target Membership section:

enter image description here