lilypuchi
10/17/2022, 3:54 AMinterface FetchTalkUseCase {
suspend fun execute(talkID: String): Talk
}
When I use KMP-NativeCouroutines to generate native async methods, this interface generates the following header file
__attribute__((swift_name("FetchTalkUseCase")))
@protocol DomainFetchTalkUseCase
@required
/**
@note This method converts instances of CancellationException to errors.
Other uncaught Kotlin exceptions are fatal.
*/
- (void)executeTalkID:(NSString *)talkID completionHandler:(void (^)(DomainTalk * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(talkID:completionHandler:)")));
- (DomainKotlinUnit *(^(^)(DomainKotlinUnit *(^)(DomainTalk *, DomainKotlinUnit *), DomainKotlinUnit *(^)(NSError *, DomainKotlinUnit *)))(void))executeNativeTalkID:(NSString *)talkID __attribute__((swift_name("executeNative(talkID:)")));
@end;
Which when I implement in Swift code is as Screenshot.
Is it working as intended? Can I restrict it to generate only the async
type ignoring the completionHandler one? 🙇Rick Clephas
10/17/2022, 5:12 AM@NativeCoroutinesIgnore
. That will prevent the generation of executeNative
.
Regarding the async and completionHandler functions. That's an Xcode bug. If I am not mistaken you should be able to implement the completionHandler function and ignore the async one.lilypuchi
10/17/2022, 11:26 AM