• henrikhorbovyi

    henrikhorbovyi

    5 months ago
    Hey, everyone What should I “git ignore” in a kmm project? is there a .gitignore template for it?
    henrikhorbovyi
    Lucas Schiavini
    +1
    7 replies
    Copy to Clipboard
  • James Black

    James Black

    5 months ago
    In my shared subproject I have this enum. I would like to loop over it in Swift to have toggles.
    enum class ClothingTypes(val clothingLabel:String) {
        BLAZER("blazer"),
        BLOUSE("blouse"),
        UNDERSHIRT("undershirt");
    
        companion object {
            fun getNumberOfItems() = values().size
        }
    }
    This code isn't going to compile but basically how would I loop over ClothTypes and get each item in the enum? I did this on the Android side already. ClothingTypes.allCases.forEach { item in Toggle(isOn: $isPushEnable) { item.text } } This is basically what I want to do in a loop. Toggle(isOn: $isPushEnable) { Text(list.get(index: 0)!.clothingLabel) } Toggle(isOn: $isPushEnable) { Text(list.get(index: 1)!.clothingLabel) }
    James Black
    1 replies
    Copy to Clipboard
  • Landry Norris

    Landry Norris

    5 months ago
    Is there currently a workaround for having a jvm and android sourceset in the same kmm module right now? I'm getting the error that the java plugin is incompatible with the Android plugin. It looks like separate source sets aren't possible right now (I want to use expect/actual for several platforms).
    Landry Norris
    James Black
    4 replies
    Copy to Clipboard
  • v

    Vivek Modi

    5 months ago
    Hey guys. I want to find application version code in Kmm. In specific platform i.e.Android
    var versionCode = BuildConfig.VERSION_CODE
    it will return
    1.1
    iOS
    let appVersion = "iOS " + (Bundle.main.versionNumber ?? "")
    it will return
    1.1
    The above code is for native. What code should I use in KMM?
    v
    hfhbd
    +1
    11 replies
    Copy to Clipboard
  • hfhbd

    hfhbd

    5 months ago
    How do you sync a SwiftUI TextField with your Kotlin ViewModel using MutableStateFlow?
    hfhbd
    n
    +1
    10 replies
    Copy to Clipboard
  • v

    Vivek Modi

    5 months ago
    Hey guys, I need your advice or any sample project. I want to call session endpoint, in which I get accessToken. I want to use in accessToken in other endpoints as a authorisation. In android side we encrypt token and store in sharedpreference. Now I want to change in KMM to share with iOS team. So what is the best way in KMM?
    v
    m
    6 replies
    Copy to Clipboard
  • j

    James Ward

    5 months ago
    In my sample multiplatform app I upgraded ktor to 2.0.0 and now I'm getting a build error:
    e: Could not find "io.ktor:ktor-utils-cinterop-utils" in [/home/jw/projects/kotlin-bars, /home/jw/.konan/klib, /home/jw/.konan/kotlin-native-prebuilt-linux-x86_64-1.6.10/klib/common, /home/jw/.konan/kotlin-native-prebuilt-linux-x86_64-1.6.10/klib/platform/linux_x64]
    Any ideas on what that means or how to resolve it?
    j
    1 replies
    Copy to Clipboard
  • Tianyu Zhu

    Tianyu Zhu

    5 months ago
    Hi all! Is there a gradle plugin similar to
    java-test-fixtures
    but for kotlin multiplatform projects?
    Tianyu Zhu
    Javier
    2 replies
    Copy to Clipboard
  • l

    Lukasz Ciastko

    5 months ago
    Hi. Can someone instruct me how to create a Kotlin Multiplatform Mobile project with App Code? The new plugin doesn’t seem to work. I select a new project and Application -> Kotlin Multiplatform Mobile. Then I enter the name and click Finish. I select a folder and click Open. The IDE goes back to the Welcome to AppCode window.
    l
    David Nedrow
    4 replies
    Copy to Clipboard
  • v

    Vivek Modi

    5 months ago
    Hey guys i am trying to communicate between kmm module and application. I tried to implement interface. In androidMain
    actual class Platform actual constructor() {
         actual val versionCode = AppConfig.versionCode
    }
    
    interface AppConfig {
        val versionCode: String
    }
    But I am getting error
    v
    Grégory Lureau
    6 replies
    Copy to Clipboard