I cannot get my swift files imported into my Obj-C project. I know, there’s a lot already on this topic on stack overflow, and I’ve tried all answers in this thread on importing Swift code to Objective-C, but I've still got the same error in spite of what I've tried for my project called Plantasia: When at the top of the script of the .m file of a pre-existing project I do
import "Plantasia-Swift.h"
I get file not found error. What I've tried:
I've set for both project and example
- "Defines Module" : YES
- "Always Embed Swift Standard Libraries" : YES
- "Install Objective-C Compatibility Header" : YES
Changed the Project Module Name to Plantasia
I’ve cleaned my build folder and tried a bunch of unlikely solutions like #import "Plantasia/Plantasia-Swift.h" , which don't work either.
- I’ve tried prepending @objc to class declaration in the .swift file.
- I’ve tried manually adding another bridging header, and specifying the "Swift Compiler – Code Generation" to my header.
- I've tested starting from a blank Objective-C project, by creating a Swift file, and referenced it successfully within .m file. This shows that it's at least working normally for me in a clean project
I've been trying for hours, and I think there must be one incorrect setting somewhere that I'm unaware of. I've tried basically most of what I could find on the forums. Any additional ideas of things I should still check? Or is there a way of manually creating this "Plantasia-Swift.h" header file?