My method takes a `val requestSystemPhotoLibraryAc...
# multiplatform
s
My method takes a
val requestSystemPhotoLibraryAccessPermission: suspend () -> SystemPhotoLibraryAccessLevel
suspend lambda. What is the correct way to call this in Swift?
requestSystemPhotoLibraryAccessPermission: {}
gives me an error as soon as I add the suspend keyword:
Argument type '() -> ()' does not conform to expected type 'KotlinSuspendFunction0'
What do I need to change? I don't understand that from the docs. 🙈
1
h
Its not possible
s
That explains a lot 😄
h
Here is something about a similar request, mapping it to `() -> Void async`: https://youtrack.jetbrains.com/issue/KT-48774
As a workaround, I use some wrapper in iosMain which takes a non suspend lambda
s
Thank you.
Will a Flow also work?
s
Thank you! 🙂
g
Can you share an example of your wrapper to a non suspend lambda @hfhbd ? Did you notice some downside/limitation of this approach?