I have a class with width and height properties in...
# multiplatform
p
I have a class with width and height properties in Kotlin declared.
Copy code
var width: Int = 0
var height: Int = 0
They turn to width_ and height_ in Swift. Do you have any idea why the underscore was added at the end of the property names?
Copy code
@property (getter=width__) int32_t width_ __attribute__((swift_name("width_")));
@property (getter=height__) int32_t height_ __attribute__((swift_name("height_")));
Any help appreciated!
Complete declaration of the class Stage
Copy code
__attribute__((swift_name("Stage")))
@interface IosUmbrellaStage : IosUmbrellaDisplayObjectContainer
- (instancetype)initWithRenderer:(IosUmbrellaMpPixiRenderer *)renderer __attribute__((swift_name("init(renderer:)"))) __attribute__((objc_designated_initializer));
- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable));
+ (instancetype)new __attribute__((unavailable));
@property (class, readonly, getter=companion) IosUmbrellaStageCompanion *companion __attribute__((swift_name("companion")));
- (void)addChildChild:(IosUmbrellaDisplayObject *)child __attribute__((swift_name("addChild(child:)")));
- (void)addChildAtChild:(IosUmbrellaDisplayObject *)child index:(int32_t)index __attribute__((swift_name("addChildAt(child:index:)")));
- (IosUmbrellaInteractionManager *)doCreateInteractionManager __attribute__((swift_name("doCreateInteractionManager()")));
- (IosUmbrellaRsBoxManager *)doCreateRsBoxManager __attribute__((swift_name("doCreateRsBoxManager()")));
- (IosUmbrellaUiManager *)doCreateUiManager __attribute__((swift_name("doCreateUiManager()")));
- (void)doDispose __attribute__((swift_name("doDispose()")));
- (void)handleScaleEventGlEvent:(IosUmbrellaRsScaleChangeEvent *)glEvent __attribute__((swift_name("handleScaleEvent(glEvent:)")));
- (void)handleScrollEventGlEvent:(IosUmbrellaRsScrollEvent *)glEvent __attribute__((swift_name("handleScrollEvent(glEvent:)")));
- (void)handleTouchEventRsEvent:(IosUmbrellaRsMotionEvent *)rsEvent timestamp:(int64_t)timestamp __attribute__((swift_name("handleTouchEvent(rsEvent:timestamp:)")));
- (void)removeChildChild:(IosUmbrellaDisplayObject *)child __attribute__((swift_name("removeChild(child:)")));
- (void)setSizeW:(int32_t)w h:(int32_t)h __attribute__((swift_name("setSize(w:h:)")));
- (void)updateTransform __attribute__((swift_name("updateTransform()")));
@property int32_t backgroundColor __attribute__((swift_name("backgroundColor")));
@property (readonly) IosUmbrellaKotlinFloatArray *backgroundColorArray __attribute__((swift_name("backgroundColorArray")));
@property (readonly) IosUmbrellaRsBoxManager *boxManager __attribute__((swift_name("boxManager")));
@property (readonly) IosUmbrellaFontManager *fontManager __attribute__((swift_name("fontManager")));
@property (getter=height__) int32_t height_ __attribute__((swift_name("height_")));
@property (readonly) IosUmbrellaInteractionManager *interactionManager __attribute__((swift_name("interactionManager")));
@property BOOL isPortraitOrientation __attribute__((swift_name("isPortraitOrientation")));
@property (readonly) IosUmbrellaMpSignal<IosUmbrellaRsScaleChangeEvent *> *onGlScale __attribute__((swift_name("onGlScale")));
@property (readonly) IosUmbrellaMpSignal<IosUmbrellaRsScrollEvent *> *onGlScroll __attribute__((swift_name("onGlScroll")));
@property IosUmbrellaMpSignal<id> *onHalfDayTick __attribute__((swift_name("onHalfDayTick")));
@property IosUmbrellaMpSignal<id> *onKey __attribute__((swift_name("onKey")));
@property IosUmbrellaMpSignal<id> *onResize __attribute__((swift_name("onResize")));
@property (readonly) int32_t orientation __attribute__((swift_name("orientation")));
@property IosUmbrellaMpPixiRenderer *renderer __attribute__((swift_name("renderer")));
@property (readonly) int64_t threadId __attribute__((swift_name("threadId")));
@property IosUmbrellaTextureAtlas *uiAtlas __attribute__((swift_name("uiAtlas")));
@property (readonly) IosUmbrellaUiManager *uiManager __attribute__((swift_name("uiManager")));
@property IosUmbrellaKotlinFloatArray *v __attribute__((swift_name("v")));
@property IosUmbrellaKotlinFloatArray *v1 __attribute__((swift_name("v1")));
@property IosUmbrellaKotlinFloatArray *v2 __attribute__((swift_name("v2")));
@property (getter=width__) int32_t width_ __attribute__((swift_name("width_")));
@end;
r
This sounds like the following issues: • https://youtrack.jetbrains.com/issue/KT-48072https://youtrack.jetbrains.com/issue/KT-43087 Is there anyway a class could inherit another
width
and
height
property with a different type?
p
@Rick Clephas thank you so much! It is. So frustrating I would have to rename width and height properties so they don’t match the properties from the other class. Weird problem.