I have added bridging header into my existing objective c project and import objective c file into bridging header using #import "classname.h". but when I am compiling the code the error is coming in objective c class(Which I added in bridging header) ask

Hi,

I am using xcode 7.3.

I have added bridging header into my existing objective c project and import objective c file into bridging header using #import "classname.h". but when I am compiling the code the error is coming in objective c class(Which I added in bridging header) asking to import uikit and foundation framework. Or if I am adding another class which is having more dependencies on another classes, it is asking to import all the dependent framework/classes. I tried adding/removing bridging header, delete derived data multiple times, but no luck. Can anyone help?

Please make sure that whichever classes, you are going to use in swift class are imported in AppName-Bridging-Header.h. Like any third party framework or any custom classes.


And one more thing you have to be sure is :
Click on your app name --> select target --> Build setting --> Build Options --> Embedded Contet Contains Swift Code is YES

I have added bridging header into my existing objective c project and import objective c file into bridging header using #import "classname.h". but when I am compiling the code the error is coming in objective c class(Which I added in bridging header) ask
 
 
Q