我的shared.h
文件中有以下定义,该定义包含在我正在开发的自定义框架中。
__attribute__((swift_name("FivestarsPayEventListener")))
@protocol SharedFivestarsPayEventListener
@required
- (void)onFivestarsPayEventFivestarsPayEvent:(SharedFivestarsPayEvent *)fivestarsPayEvent __attribute__((swift_name("onFivestarsPayEvent(fivestarsPayEvent:)")));
@end;
当我构建项目时,会生成大多数绑定(它们用 注释@interface
)。
为什么 appcelerator 不为带@protocol
注释的标头生成绑定?
您可以看到生成了许多其他 javascript 绑定。例如,sharedaction
它是这样定义的
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("Action")))
@interface SharedAction : SharedKotlinEnum<SharedAction *>
+ (instancetype)alloc __attribute__((unavailable));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable));
- (instancetype)initWithName:(NSString *)name ordinal:(int32_t)ordinal __attribute__((swift_name("init(name:ordinal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable));
@property (class, readonly) SharedAction *getFullPath __attribute__((swift_name("getFullPath")));
@property (class, readonly) SharedAction *removeFile __attribute__((swift_name("removeFile")));
@property (class, readonly) SharedAction *writeToFile __attribute__((swift_name("writeToFile")));
@property (class, readonly) SharedAction *writeBytesToFile __attribute__((swift_name("writeBytesToFile")));
@property (class, readonly) SharedAction *readFile __attribute__((swift_name("readFile")));
@property (class, readonly) SharedAction *readFileCompressed __attribute__((swift_name("readFileCompressed")));
@property (class, readonly) SharedAction *getFiles __attribute__((swift_name("getFiles")));
@end;