Is it not possible to declare additional
initWith...
functions (constructors) in an ObjC category in a .def file? I've had success declaring properties and functions that aren't in the public API of an ObjC class, but adding an
initWith...
function doesn't add the constructor definition (or the
@Deprecated initWith...
function that is usually generated with the constructor).
For example, where
MyObjCClass
is previously declared in a public API header:
@interface MyObjCClass (Internal)
@property (nonatomic, readonly, nonnull) NSString *foo;
- (BOOL) isBar;
- (instancetype) initWithFoo: (NSString)foo bar: (BOOL)bar;
@end
Adds extension functions on the class definition, instead of modifying the class defined by the public API header:
expect val MyObjCClass.foo: NSInteger
@ObjCCallable external expect fun MyObjCClass.foo(): NSInteger
@ObjCCallable external expect fun MyObjCClass.isBar(): Boolean
There is nothing added for the
initWithFoo:bar:
constructor though.