Is it possible to explicitly declare that a Swift source file isn't included in the Objective-C Generated Interface Header? As an example, let's say I have this Swift class
class MyViewController: UIViewController {
}
In my MyApp-Swift.h
generated header, I see this
SWIFT_CLASS("_TtC4MyApp16MyViewController")
@interface MyViewController : UIViewController
- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil OBJC_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
@end
However I would prefer this class isn't exposed to Objective-C. I'm working in a larger app, and our generated -Swift.h
file is well over 8,000 lines. This ends up making incremental builds painful when something that should only require a recompilation of the Swift code ends up causing a recompilation of the Objective-C code as well simply because this header file changed.
@nonobjc
sadly does not work. I receive the error '@nonobjc' attribute cannot be applied to this declaration
.