Skip to content

How to actually use Kotlin files? #119

Answered by marcprux
hadiidbouk asked this question in Q&A
Discussion options

You must be logged in to vote

We mention at https://skip.tools/docs/platformcustomization/#calling-kotlin-api that any Kotlin embedded in Swift code needs to follow Swift syntax conventions. We'll add some concrete examples soon, but the issue causing your error is that you are passing named argument with = (as Kotlin expects) rather than with : (as Swift expects), and you are passing the closure argument like bitmap -> (as Kotlin expects), rather than bitmap in (as Swift expectes).

So the equivalent swift-ified code would look something like:

#if SKIP
.overlay {
    if viewModel.isPickerActionSheetPresented {
        ComposeView { _ in
            ImagePickerBottomSheet(cameraLauncher: androidx.activity.compose.remem…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@hadiidbouk
Comment options

Answer selected by hadiidbouk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants