Adrian Witaszak
06/09/2023, 5:07 PMRizwan
06/14/2023, 12:22 PMRizwan
06/14/2023, 12:23 PMStefan de Kraker
06/15/2023, 8:23 AMDarron Schall
06/28/2023, 1:44 PMAhmad Hassan
07/12/2023, 4:49 AMshaktiman_droid
07/12/2023, 7:00 PMAhmad Hassan
07/14/2023, 8:35 AMRomão
07/17/2023, 5:22 PMSarah Brenner
07/21/2023, 6:02 PMprivate val _products = MutableStateFlow<List<Product>>(emptyList())
val products = _products.asStateFlow().cStateFlow()
Now, in iOS, I’m trying to create a list, but this doesn’t work; I’m not sure how to write it or if I’m doing it right:
List {
ForEach(homeViewModel.state(\.products), id: \.id) { product in
Text(product.title)
}
}
Is there a way to do something simple like this, or do I need to do something like this (mirror the BookList functionality)?
https://github.com/icerockdev/moko-mvvm/blob/master/sample-declarative-ui/shared/src/commonMain/kotlin/dev/icerock/moko/mvvm/sample/declarativeui/BookListViewModel.kt
I also found this pattern, where the flow is collected:
https://github.com/rvenky125/NoteKMM/blob/master/iosApp/iosApp/NoteIOSViewModel.swift
I guess my question is: what is the easiest way to loop through these values in iOS? In compose, I just do this, and access the value:
val products = viewModel.products.collectAsStateWithLifecycle()
MarkRS
07/25/2023, 4:12 PMMarkRS
07/26/2023, 2:10 PMget() = TODO("Not yet implemented")
Err,. really?Alejandro Rios
07/31/2023, 6:52 PMmoko-resources
on it, but I'm sure were do I need to add this part:
buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath "dev.icerock.moko:resources-generator:0.23.0"
}
}
Have any of you had something similar?
Does "dev.icerock.moko:resources-generator:0.23.0"
have a Kotlin DSL equivalent?
Right now I can't get my resource located in commonMain/resources/MR/files/mini.txt
Romão
08/02/2023, 9:39 AMRomão
08/02/2023, 10:15 AMAnum Amin
08/05/2023, 10:08 PMmoko-socket-io
in my KMP project. Getting following error while syncing:
The following build commands failed:
Ld /Users/Admin/Desktop/KMM/KMP-Project/shared/build/cocoapods/synthetic/IOS/build/Release-iphoneos/Starscream/Starscream.framework/Starscream normal (in target 'Starscream' from project 'Pods')
(1 failure)
Any idea how to resolve this? Thanks. I tried with Java 1.8, 11 and 17 on Ventura OSX if it matters. I updated cocoapods few days ago so it shouldn't be a problem IMO.Farid Benhaimoud
08/06/2023, 2:02 PMVlad
08/07/2023, 1:13 PMMOBILE.SOME_CHAPTER.TITLE
. We sync that file via cicd on post clone.
Internally we have MR.base.strings.xml with links to that Vocabulary file:
<string name="my_chapter">@string/MOBILE.SOME_CHAPTER.TITLE</string>
That came from our android project and it doesn't work for iOS in KMP.
For iOS it compiles into:
"my_chapter" = "@string/MOBILE.SOME_CHAPTER.TITLE";
Francis Mariano
08/10/2023, 8:18 PMAdam Brown
08/15/2023, 3:38 AMJacky
08/17/2023, 4:24 PMgetViewModel
. This, however, requires to create an instance of view-model - what If I have some dependencies in my view-model that should be injected (by Koin). Is this correct thinking of mine or it's not quite possible to have same UI and view-model for Android and iOS? Thanks.jamshedalamqaderi
08/24/2023, 11:45 AMMike Dawson
08/28/2023, 8:27 PMkevin.cianfarini
08/28/2023, 10:07 PM- shared
-- resources
-- feature-1
-- feature-2
Do I need to configure the multiplatformResources
block, or can I just apply the plugin to bubble up strings from resources
to shared
on iOS?jamshedalamqaderi
08/30/2023, 10:18 AMVladimir Malykhin
08/30/2023, 11:43 AMval commonMain by getting {
dependencies {
implementation("com.squareup.sqldelight:runtime:1.5.5")
implementation("com.squareup.sqldelight:coroutines-extensions:1.5.5")
implementation("io.ktor:ktor-client-core:2.3.2")
implementation("io.ktor:ktor-client-logging:2.3.2")
implementation("io.ktor:ktor-client-content-negotiation:2.3.2")
implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1")
implementation("commons-codec:commons-codec:1.15")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.5.1")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
api("dev.icerock.moko:mvvm-core:0.12.0") // only ViewModel, EventsDispatcher, Dispatchers.UI
api("dev.icerock.moko:mvvm-livedata:0.12.0") // api mvvm-core, LiveData and extensions
api("dev.icerock.moko:mvvm-state:0.12.0") // api mvvm-livedata, ResourceState class and extensions
api("dev.icerock.moko:mvvm-livedata-resources:0.12.0") // api mvvm-core, moko-resources, extensions for LiveData with moko-resources
implementation(compose.ui)
implementation(compose.foundation)
implementation(compose.material)
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.components.resources)
implementation(compose.runtime)
implementation(compose.materialIconsExtended)
implementation("dev.icerock.moko:mvvm-compose:$mokoMvvmVersion")
implementation("dev.icerock.moko:permissions-compose:$mokoPermissionsVersion")
implementation("dev.icerock.moko:media-compose:$mokoMediaVersion")
implementation("dev.icerock.moko:geo-compose:$mokoGeoVersion")
// fix of Could not find "shared/build/kotlinTransformedMetadataLibraries/commonMain/org.jetbrains.kotlinx-atomicfu-0.17.3-nativeInterop-8G5yng.klib"
implementation("org.jetbrains.kotlinx:atomicfu:0.17.3")
How can I fix it?Ahmad Hassan
08/30/2023, 12:22 PMMike Dawson
08/30/2023, 6:50 PMTravis Reitter
08/31/2023, 4:03 PMMR.kt
seems to be generated properly for iosMain
but the iOS build is failing with:
Cannot locate tasks that match ':shared:copyFrameworkResourcesToApp' as task 'copyFrameworkResourcesToApp' not found in project ':shared'.
Patrick Cavanagh
09/04/2023, 7:11 AM