user1960169
user1960169

Reputation: 3653

objective-c Bridging header not found in swift compiler-code generation

I am doing an ios app in swift 3. And I want to add ARKitwhich is available in objective-c. I dragged all objective-c files into my project then it asked to create bridging header. So I let it to create. And I imported all objective-c.h files inside that like this.

enter image description here

But when I try to build its showing 22 number of issues like UIViewcannot identify etc..

Then I tried to add the bridging headerpath to build settings under swift compiler - code generation. But I dont see objective-c Bridging headersection under that.

enter image description here

enter image description here

Please help me. What can I do to add these objective-c files into my swift 3 project successfully. Thanks

Upvotes: 1

Views: 1199

Answers (2)

ssowri1
ssowri1

Reputation: 1317

Make sure your build setting is selected as "All" and "Combined" look at below link

Swift Compiler - General is missing in Xcode 9.1

Upvotes: 2

vrwim
vrwim

Reputation: 14380

The Objective-C bridging header setting can be found under Swift Compiler - General under Build Settings.

But I like to add the bridging header by having Xcode generate it for me. I add a junk Objective-C class by File > New > File... and it will ask me if I want to add a bridging header to my project.

If you do that, you'll only need to move whatever you have in your bridging header now to that one and delete the header you have now. The header will be set properly in the project's settings.

Upvotes: 2

Related Questions