0

Does the -import-objc-header option of the Swift compiler define any macro that can be used to determine whether a header is being parsed by the Swift importer?

For example, given the following bridging header:

@interface FooClass

- (void)publicMethod;

#ifdef SWIFT
- (void)callableFromSwiftOnly;
#else
- (void)callableFromObjcOnly;
#endif

@end

Is there a 'SWIFT' or similar preprocessor token defined when the importer parses the header?

Jake Petroules
  • 22,632
  • 35
  • 139
  • 223

1 Answers1

0

the header-file that you define as bridging-header is only used by one target so it's safe to just define everything there using #define

Karsten
  • 2,662
  • 15
  • 20