1

I have a Swift project in which i want to use an sdk which is in a form of library files .a and .h files (written in Objective-C)

How do i use the code inside my swift project?

When i add the files to my project it dont give the option to create an objective-c bridging header

Michael A
  • 5,770
  • 16
  • 75
  • 127

1 Answers1

0

To create a bridging header:

  1. Add a new Header file to your project. File -> New -> Header file. I named it: "Your-Header-file.h"
  2. Go to your project Target -> Build Settings, search for Objective-C Bridging Header and set the header file's path in this field. You can do this by double-click Objective-C Bridging Header field, a panel show up, drag the header file to this panel.

enter image description here

  1. include .h file you need to use in Your-Header-file.h.
Bao Nguyen
  • 137
  • 9