0

I've import framework in project and create a bridge header since project is in swift.

Now, I want to invoke method getChallengeDeviceId() present in Common.h header file in CommonLibrary framework.

Screenshot 1

Screenshot 2

How can this be done?

Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177

2 Answers2

1

Use OC code in Swift project:

1.Creat a file: produceName-Bridging-Header.h

2.Set targets->build settings ->Object-C Bridging Header to produceName-Bridging-Header.h in building settings.

3.Import .h file in produceName-Bridging-Header.h.

For u, #import <CommonLibrary/Common.h>

4.U can use the OC class.

In your case, maybe you should use like this:

let common = Common()//Or any other init method(Maybe a singleton or somthing)
common.getChallengeDeviceId("iPhone5S")

enter image description here

Tony
  • 542
  • 3
  • 13
0

1 Go to targets->build settings ->Object-C Bridging Header

  1. Try this $(SRCROOT)/Productname/Productname-Bridging-Header.h