How to use Swift classes into Objective Code when you have multiple targets.
For using Swift classes in Objective-C Code when you have one target in your app. We generally need to and
import TargetName-Swift.h next to add support in your Swift file you need to inherit if from
NSObject or use
What if you have multiple targets in your codebase? As you cannot import,
TargetNameB-Swift.h etc. In that case, you can tell the compiler that not to create Swift module specific to target change it to project name because the project will be same and unique.
For achieving this select your every target, Build Settings and change the build configuration.
Objective-C Generated Interface Header Name —> replace $(SWIFT_MODULE_NAME)-Swift.h that is specific to the each target, with $(PROJECT_NAME)-Swift.h
Later import PROJECT_NAME-Swift.h in your Objective C code to make use of your Swift code.