Looking at this DroidCon London talk, this slide s...
# touchlab-tools
c
Looking at this DroidCon London talk, this slide shows how a Kotlin interface with a suspend function has been implemented in Swift.

https://www.youtube.com/watch?v=0gnBzIqox1k&list=PL9Pfzam3fFde4NtK6Nkca3zsK7Pg2Juqy&index=3&t=258s▾

A function
suspend fun generateImage(prompt: String): ByteArray?
is implemented on Swift as
func generateImage(prompt: String) async throws -> KotlinByteArray?
However, in my experience, when I allow Xcode to generate the functions for conforming to such a protocol, it would generate 2 overloads for each suspend function 1. One that takes a completionHandler 2. An async one, but prefixed with a double-underscore I've been deleting the first one and retaining the second one. In the above example, it would be
func __generateImage(prompt: String) async throws -> KotlinByteArray?
If I remember correctly this is because this async function does not support cancellations (at least not in all situations), and I suspect this might have something to do with SKIE. Has there been a change in this area recently? Is my understanding outdated?
@John O'Reilly curious - don't you see the behaviour I mentioned if you allow Xcode to generate the overrides for protocol conformance?