4

I have a Swift project in which I'm using an Objective-C class. I've done this by importing the .h file inside my bridging header. Everything works fine.

Now I need to use a Swift class inside this Objective-C code, so I imported the $ModuleName-Swift.h inside my Objective-C .h file. Now Xcode complains that this file wasn't generated. The interesting part: When I do not import the Objective-C .h file inside the bridging header (so I do not use the Objective-C code in my Swift project) the $ModuleName-Swift.h file works and I can use Swift code inside my Objective-C code.

Is there only a one-way solution for this? (either use swift code in objc or vice versa)

Thanks

1 Answer 1

0

Imported the $ModuleName-Swift.h inside your objc .m file.

If you need your swift class in the objc .h file, write @class YourSwiftClass; after the #import lines in .h file

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.