One of my java classes implements 2 methods:
public OutputStream getOutputStream(){
return null;
}
public int getV(){
return 3;
}
After conversion with j2Objc, I try to call those methods in swift:
func test() {
let i = ComExampleTestSharedMyClass()
var v = d.getV()
var s = d.getOutputStream()
}
Instantiation and getV() compiles pretty well but getOutputStream() doesn't with the message:
ComExampleTestSharedMyClass has no member getOutputStream.
In MyClass.h, I can see both translated methods:
- (jint)getV;
- (JavaIoOutputStream *)getOutputStream;
The obvious difference is about the returned type which is part of jre_emul.
For testing purpose, I did a test in objective-C (my first attempt!):
#import "Configurator-Bridging-Header.h"
@implementation TestGetOutputStream
- (void) theTest{
ComExampleTestSharedMyClass* i = [ComExampleTestSharedMyClass alloc];
[i getOutputStream];
}
@end
It compiles with objective-C, so what can I do for swift?