Hey hi guys, I have a KMM project and I would like...
# moko
s
Hey hi guys, I have a KMM project and I would like to add Moko. The project just uses a framework for iOS instead of a Cocoapod do i need to setup a script like with Compose multiplatform to copy the resources?
a
hi. you use static framework? and want to use moko-resources?
s
I think, just the standaard example app for KMM
I would like to use moko-resources to share strings
a
by default framework is dynamic. with dynamic framework moko-resources nothing required on xcode side.
*only setup of localizations list in Info.plist
s
Ahh is that needed even if just using a single language?
a
yes, it's xcode requirement to work with localizations at all
s
Do I need to make methodes in the commonMain like in the docs?
Copy code
fun getMyString(): StringDesc {
    return StringDesc.Resource(MR.strings.my_string)
}
Or can I just use the
<http://MR.Strings.my|MR.Strings.my>_string
directly in the compose and swift ui. Seems like alot of work to make a methode for each string
a
you can call MR directly if you want
s
Ahh oke, what am I missing here ­čśů
stringResource(id = MR.strings.overview_favorites_title.resourceId)
a
read readme please
s
I'm unable to call
MR.strings().overview_pokemon_title.desc().localized()
in swiftUI
a
you add
export
declarations in build gradle?
s
Copy code
listOf(
    iosX64(),
    iosArm64(),
    iosSimulatorArm64()
).forEach {
    it.binaries.framework {
        baseName = "shared"
    }
}
Do I need to add it here?
a
yes. it's also described in readme ­čÖé
s
My bad!
Working great!