Liang Song
06/27/2019, 10:37 PM1.3.40
, I have two interfaces
interface CompletionHandler<T> {
fun onCompletion(result: T)
fun onException(exception: Exception)
}
interface TestGenerics {
fun test(completionHandler: CompletionHandler<String>)
}
the signature of TestGenerics
in the generated Objective-C header is
__attribute__((swift_name("TestGenerics")))
@protocol TMDTestGenerics
@required
- (void)testCompletionHandler:(id<TMDCompletionHandler>)completionHandler __attribute__((swift_name("test(completionHandler:)")));
@end;
Looks like it is still not supportedbasher
06/27/2019, 11:03 PMLiang Song
06/27/2019, 11:14 PMCompletionHandler
to a class,
typealias OnCompletion<T> = (result: T) -> Unit
typealias OnException = (exception: Exception) -> Unit
class CompletionHandler<T>(val onCompletion: OnCompletion<T>, val onException: OnException)
the signature of TestGenerics
in the generated Objective-C header
__attribute__((swift_name("TestGenerics")))
@protocol TMDTestGenerics
@required
- (void)testCompletionHandler:(TMDCompletionHandler<NSString *> *)completionHandler __attribute__((swift_name("test(completionHandler:)")));
@end;
ribesg
06/28/2019, 7:24 AM