Is there a best practice for suspending functions ...
# multiplatform
h
Is there a best practice for suspending functions in an interface that needs to be implemented on both iOS and Android using SKIE?
f
Hi! I’m not sure if you can call this a best practice, but implementing suspend functions in Swift is possible; however there are some limitations. (These don’t apply to Android as SKIE doesn’t do anything there). The function that you need to implement is prefixed with “__” because the function you will call from elsewhere is an extension that cannot be overridden. This prefixed function is the original Kotlin function that you would use without SKIE. Therefore, it can use the “async/await” syntax, but it does not support the cancellation propagation. I don’t think there is a way around that unfortunately.
👍 1
h
Thanks