简体   繁体   中英

Can't import into Swift bridging header Objective-C file that imports Project-Swift.h

I'm trying to #import an Objective-C class to my Project-Bridging-Header.h. The problem is that the same class has an #import to my "Project-Swift.h" file. So - I'm getting a compilation error.

How can I solve this?

You can do a forward declaration of the enum:

enum myEnum;

But this doesn't get you very much . The prevailing wisdom is to define any cross language enums in an Ojective-C context.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM