I want to create a custom framework using Swift. There're some Swift files in the framework, then I create a new Objective-C file named A (A.h and A.m).
Within this Objective-C file, I want to use another Swift class so I add a following import statement on the top of the A.m file
#import "<My framework target name>-Swift.h"
When building framework, I got error that indicates '-Swift.h' not found.
I worked around some solutions but still get stuck
- I add an bridging header file but failed due to custom framework not allows bridging header.
- I turned on 'Defines Module' to YES on Build Settings but seems useless.
Adding '$(CONFIGURATION_TEMP_DIR)/Product Name With Spaces.build/DerivedSources' to Header Search Path doesn't help.(following this thread iOS - 'MyProject-Swift.h' file not found when running Unit Tests for Swift , @gagarwal 's answer)
I also tried to move the import statement to umbrella header, but the same error occurs.
How can I use Swift class in the Objective-C file?