I have an Objective-C category that I have used for some time for iOS and OSX projects, and I want to use them in my Swift project as is ... until I have time to switch it to Swift.
At the top of my category is an .h file:
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif
I included it in the header of the bridge, but when I create a project for iOS, I get an error that it cannot find the Cocoa / Cocoa.h file.
Why is he even looking for him? Does conditional compilation not work even in a Swift project? It still compiles the Objective-C file.
Thank.
source
share