0

I need to extend the functionality of a library Pod written in Objective C (the rest of the project is in Swift). I created the MyClass+Category .h and .m files (as a Category), with the pod selected as target, but I get a file not found error in the header at:

#import <MyLib/MyLib.h>

How do I get the category's header to find the original class?

An alternative would be to write the extension in Swift, are there any gotchas there I should be aware of?

Also grateful for any better ways there might be.

HenryRootTwo
  • 2,572
  • 1
  • 27
  • 27
  • 1
    Usually you will have to address the framework: `#import `. Can you be a little bit clearer about the structure of the class you are attempting to categorize? – Ian MacDonald Aug 21 '18 at 21:02
  • That seems to have done it. Strange that Xcode asks me which class I am creating a category for, then gives me an import statement that doesn't work. I'll edit the post to reflect the actual import statement I got, in case it helps someone else. – HenryRootTwo Aug 21 '18 at 21:14
  • Cocoapods generates umbrella header file with ugly `-umbrella` suffix. Thy `#import ` – Cy-4AH Aug 22 '18 at 14:58

1 Answers1

0

Adding a Bridging Header in Your Project. then import your category in BridgingHeader class. you easily access your category.

how to add header file please see this link. https://stackoverflow.com/a/39615171/8687925

SAXENA
  • 423
  • 1
  • 4
  • 17