You can add a Swift file in Xcode as a translation layer to use the Kustomer Chat SDK Swift APIs in an Objective-C project.
In the translation layer Swift file, use the `
@objc` keyword to expose the available classes and methods to the Objective-C project.
Do I need to add a bridging header file?
No. While Xcode prompts you to add a bridging header file when you add your first Swift file to an Object-C project, a bridging header file is unnecessary to expose the Swift APIs to your Objective-C code.
To learn more, see _[Importing Swift into Objective-C](🔗)_ in the Xcode documentation.
## Translation Layer implementation
We've provided a sample translation layer Swift file below.
Once you have your translation layer, import the project file with your Objective-C project code and corresponding Swift file into your `
AppDelegate.m` file to implement the translation layer.
We've included a code sample below.
Importing your Objective-C project code and translation later into `
#import "YourProjectName-Swift.h"` imports the Objective-C project that contains your Objective-C project code and the translation layer Swift file. Replace `
YourProjectName` with the name of the relevant project.