Reputation: 1187
I have created a Swift project and imported Objective-C files. During import Xcode asked me to create a bridging header and created a header.
Now in the Objective-C files of the same project I want to use Swift class methods. I googled about importing Swift code in an Objective-C file. I found that we have to import ProjectName-Swift.h
in the Objective-C file. My questions are as follows:
Upvotes: 4
Views: 810
Reputation: 13893
This seems really messed up, but the ProjectName-Swift.h
file isn't visible. You just have to #import ProjectName-Swift.h
in your Obj-C classes, and it'll work.
Upvotes: 2