0

I setup a podspec for my repo (framework). In my repo, there are some swift classes, I would like these swift classes be availble to some objC classes in the same repo. I know xcode will automatically generate a header file: product-Swift.h file, so that object-c class can use swift classes by importing this header file. my question is that how do I setup podspec file so that this swift header file can be generated and objC class can import it ?

in my podspec file, I enable module definition and generate interface build header file for swift. but I can not get my objC class compiled since the product-Swift.h file can not be found.

 s.xcconfig = { 'DEFINES_MODULE ' => 'YES', 'SWIFT_OBJC_INTERFACE_HEADER_NAME' => 'Product-Swift.h' }

any ideas are welcomed, thanks in advance.

Rugmangathan
  • 3,186
  • 6
  • 33
  • 44
Ronnie
  • 23
  • 4

1 Answers1

0

you can do this by adding @obcj prefix to you class name. btw, you'll have to re-build your project before objective c will know the class

@objc class myClass{
     //this class will be available in Objective c
}
Daniel Krom
  • 9,751
  • 3
  • 43
  • 44
  • Hi. By doing this the Swift.h file is created, but i dont see any swift file is being included though. – Kesava Jan 16 '17 at 14:59