Is there a Swift macro defined when importing brid

2019-09-07 00:20发布

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?

标签: swift
1条回答
一夜七次
2楼-- · 2019-09-07 01:03

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

查看更多
登录 后发表回答