Grégory Lureau
10/10/2021, 1:38 PMopen class BaseClass(internal val internalVal: String)
class FooBar(val exposedVar: Int) : BaseClass("internalValue")
In Kotlin I only see one and only one FooBar constructor with the Int
param. But the header from XCFramework exposes 2 constructors
__attribute__((swift_name("BaseClass")))
@interface KmpTestBaseClass : KmpTestBase
- (instancetype)initWithInternalVal:(NSString *)internalVal __attribute__((swift_name("init(internalVal:)"))) __attribute__((objc_designated_initializer));
@end;
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("FooBar")))
@interface KmpTestFooBar : KmpTestBaseClass
- (instancetype)initWithExposedVar:(int32_t)exposedVar __attribute__((swift_name("init(exposedVar:)"))) __attribute__((objc_designated_initializer));
- (instancetype)initWithInternalVal:(NSString *)internalVal __attribute__((swift_name("init(internalVal:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable));
@property (readonly) int32_t exposedVar __attribute__((swift_name("exposedVar")));
@end;
I know I could make the BaseClass constructor private to avoid that export, but it doesn't feel adequate to exposes this 2nd constructor on FooBar anyway... What am I missing?
Also I noticed the unavailable
not sure what this means 😕Grégory Lureau
10/10/2021, 1:46 PMGrégory Lureau
10/11/2021, 8:51 PM