当我创建Swift类时,Xcode会将这个Swift类添加到swift.h中。但是,在swift.h中仍然没有添加任何内容。
Normal swift.h:
SWIFT_CLASS("_TtC8facebook19swiftViewController")
@interface swiftViewController : UIViewController
- (void)viewDidLoad;
- (void)didReceiveMemoryWarning;
- (SWIFT_NULLABILITY(nonnull) instancetype)initWithNibName:(NSString * __nullable)nibNameOrNil bundle:(NSBundle * __nullable)nibBundleOrNil OBJC_DESIGNATED_INITIALIZER;
- (SWIFT_NULLABILITY(nonnull) instancetype)initWithCoder:(NSCoder * __nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;但是,前面提到的Swift类没有包含在我的swift.h中:
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
#pragma clang diagnostic pop发布于 2015-08-27 09:16:46
Swift类只有在使用@objc声明或(直接或间接)从NSObject派生时才会添加到-Swift.h文件中。
https://stackoverflow.com/questions/31017099
复制相似问题