why should i use kmm instead of learning a swift ui ? what make it the pest to android developer to use ?what it give to me so i con use it? as in your video you create the swift ui by your self then create viewmodel so kmm give me the network layer and DB only
Kotlin 1.7.20 is broken with KMM. All calls to suspend functions return on a background thread even though they were called from a main thread on iOS. The suspend functions in my app internally use default dispatcher. After updating to 1.7.20 all suspend calls get this warning in Xcode: "Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates." On 1.7.10 and before, it always returned on the main thread. Even though IO dispatcher is used on Android it still returns on the main thread as expected, only on iOS and after 1.7.2 is it still in the background thread in the iOS callback.
@@michaelndiritu6413 Yes but this has nothing to do with my code. This can be reproduced by having a regular suspend function with a withContext default dispatcher block inside it, which is what we are supposed to have to get multithreading to work on iOS.
I agree that this could be problematic. This is because 1.7.20 has kmm new memory model enabled by default. On Android when you launch the coroutine you use MainScope (Dispatchers.main), so this will tell the coroutines to resume on the main thread when the background work is done. On iOS you don't write that code, i think they are using the Unconfined dispatcher which means the continuation will run on the background thread. I am not sure if they can do better than that, they mentioned that this will be the behavior for the new memory model a year ago...
@@eliekarouz6397 But I was also using the new memory model prior to 1.7.20 by enabling it in gradle properties and it switched back to main. So there must be something different with it in 1.7.20 compared to the experimental version. Here's another thing: A month ago when I upgraded to Ktor version 2, prior to 1.7.20 the same problem happened. So now I am still using 1.7.10 and the 1.6.8 version of Ktor. I think it's strange that it is intentional that we must always dispatch to main in the callbacks on iOS, but I haven't heard or read anything about it so i don't know if I should just do that and update or wait. Regarding MainActor I have tried the annotations in the view models/observable objects where these functions are called but it didn't do anything, don't know why. Haven't tried async await, I am just using the regular generated callbacks that you get when calling a suspend function from iOS and calling those from view models/observable objects on the main thread.
Hello Admin, I have an existing Android Project which I convert it into KMM. I used Kotlin Multiplatform Shared Module to do the magic but you got stuck due to the error ExperimentalKotlinGradlePluginApi class. Can you please help.
Not great, I’m to OCD to deal with people that use “Umm and Uhhh” excessively when they speak 🗣️, it’s so distracting and a sign of nervous ignorance about whatever there talking about. In a normal setting it’s fine, but in a professional presentation or Enterprise training, it’s distracting af. Try and listen for it, 😂 it’s all you will hear and probably get on your nerves too. I’m not especially happy about iOS’s hardened version either. dweeb 🎃Happy Halloween 👻 thank bla bla bla for transcription services.
I'd much rather listen to super experienced engineer with that issue than super experienced marketing specialist who had no technical background. I don't expect all engineers to be awesome speakers but that doesn't change the fact they have something awesome to say
As much as I don't want to complain, specially since this is free, you are right that it can be very distracting. I hope he gets this feedback and work to improve his presentation and speech skills, as this does impact the spread of their work