https://kotlinlang.org logo
Join Slack
Powered by
# compose-ios
  • f

    Fedor Sorokin

    07/14/2025, 12:51 PM
    Submitted bug with overlapping text field by dropdown menu and ignoring ime padding on iOS https://youtrack.jetbrains.com/issue/CMP-8574 Has anyone encountered this problem in their app? Have you found the temporary solution?
    a
    • 2
    • 6
  • m

    Matthew David

    07/14/2025, 11:24 PM
    It seems that
    imePadding
    lags behind the iOS keyboard, is there some preferred way of syncing with the keyboard or does this need to happen outside of Compose?
  • c

    Chethan N

    07/15/2025, 11:04 AM
    Hi, I'm trying to analyse the .framework file size for the release variant of the iOS app. I can see that the size is big when I run iOS in the release configuration. I tried a few well know apps like KotlinConf app and I can see the shared.framework binary file is around 200MB locally. However, the app size on app store is much smaller. What is the right way to analyse the size?
  • d

    Debayan

    07/17/2025, 10:57 AM
    Is there any plugin of some sort to show the physical attached ios devices in Android Studio just like we have for Android Devices? I am running Narwhal Canary 9
  • a

    arnaud.giuliani

    07/17/2025, 12:52 PM
    Hey Folks 👋 I'm checking if we have
    SavedStateHandle
    support for
    ViewModel
    in iOS, or is it yet limited to Android side?
    c
    • 2
    • 5
  • s

    Suresh Maidaragi

    07/18/2025, 6:39 AM
    Uncaught Kotlin exception: kotlin.IllegalStateException: Currently, UIKitViewController cannot be used within Popups or Dialogs
    hi is this available to use? if so in which version?
    m
    • 2
    • 3
  • j

    Jeffrey Bush

    07/18/2025, 2:13 PM
    Hiding the status bar when a specific native UIViewController is being shown with
    UIKitViewController
    Compose call? I have tried a few things:
    UIApplication.sharedApplication.setStatusBarHidden(true, UIStatusBarAnimation.UIStatusBarAnimationNone)
    but this is deprecated in iOS 10 (9 years ago) and has problems that if the app is closed/crashed in between the call with
    true
    and
    false
    the next time the app is started the status bar is still hidden... Then I found out that the
    ComposeUIViewControllerConfiguration
    has a delegate that can help control this a bit better, but that delegate is also deprecated now with a suggestion to create a parent
    UIViewController
    around the Compose Host UIViewController, so I tried the following but this causes issues with the sizing of the entire Compose hierarchy (basically seems to assume the initial viewport never changes regardless of rotations and other updates). How to fix this? Is there some additional methods to override in the
    UIViewController
    wrapper that will fix it? Thanks!
    Copy code
    class MainViewControllerWrapper(val vc: UIViewController): UIViewController(null, null) {
        @OptIn(ExperimentalForeignApi::class)
        override fun loadView() {
            super.loadView()
            vc.willMoveToParentViewController(this)
            vc.view.setFrame(view.frame)
            view.addSubview(vc.view)
            addChildViewController(vc)
            vc.didMoveToParentViewController(this)
        }
    
        override fun prefersStatusBarHidden() = anyPrefersStatusBarHidden()
        companion object {
            fun UIViewController.anyPrefersStatusBarHidden(): Boolean =
                childViewControllers.any { (it as? UIViewController)?.anyPrefersStatusBarHidden() == true }
        }
    }
    • 1
    • 1
  • d

    Dhiraj Chauhan

    07/21/2025, 11:27 AM
    Seeing iOS app crash in production with Compose Multiplatform (1.8.1, Kotlin 2.2.0). The crash happens inside
    Surface.makeFromBackendRenderTarget
    , but I can't figure out the root cause from the stack trace. Stack trace in 🧵
    a
    • 2
    • 2
  • c

    Chiaradia Juan

    07/22/2025, 1:17 PM
    Hi all, maybe I have some more luck here 🙏
  • c

    Csaba Szugyiczki

    07/23/2025, 8:27 AM
    Reheating the iOS Accessibility topic. By default, neither
    OutlinedTextField
    nor
    TextField
    sets up additional accessibility info such as label or any additional info like placeholder value or supportingText, on iOS. Meanwhile on Android these are handled well. Is there something I miss, or is it intentionally so minimally supported on other platforms?
    a
    • 2
    • 6
  • a

    Arne Vanstraeseele

    07/23/2025, 1:08 PM
    Hi, I need to check when my app is destroyed (totally closed) in iOS. I look at the docs and I found the mapping between Android and iOS around LifeCycle. But viewControllerDidLeaveWindowHierarchy is actually not available in the iOS docs and ON_DESTROY isn't called in an iOS app. Is this a bug or is it intended?
    a
    j
    • 3
    • 4
  • d

    Debayan

    07/25/2025, 11:46 AM
    Is there any other way to access observeValueForKeyPath other than following the below process: https://proandroiddev.com/leveraging-key-value-observing-kvo-in-kotlin-multiplatform-kmp-for-ios-231519e5c1ff
    r
    • 2
    • 8
  • g

    Gilberto Hernández

    07/27/2025, 6:16 PM
    Hello, Has anyone worked with AVPlayer? - I'm trying to get the
    clickable
    event from Box., but does not work like Android.
    Copy code
    Box(
            modifier = Modifier
                .fillMaxSize()
                .background(Color.Black)
                .testTag("VideoPlayer-Player")
                .clickable {
                    viewModel.showControls = !viewModel.showControls
                    println("🎯 Touch screen detected! -> Box ")
                }
        ) {
            PlayerView(
                avPlayerViewController = avPlayerViewController,
                modifier = Modifier.fillMaxSize(),
                onTouchScreen = {  }
            )
        }
    r
    u
    • 3
    • 4
  • f

    ferdialif02

    07/30/2025, 3:56 AM
    Hi, my project is using compose multiplatform, and i got this frequent error : #11 0x0000000102c20c24 in kfun:org.jetbrains.skia.DirectContext#flushAndSubmit$default(org.jetbrains.skia.Surface;kotlin.Boolean;kotlin.Int){} () My project libs version : Kotlin : 2.2.0 CMP : 1.9.0-beta01 crashes occured on iOS devices
    a
    • 2
    • 6
  • s

    skominas.ainis

    08/01/2025, 12:08 AM
    What icons library or approach do you use in Compose Multiplatform? Currently, I am using compose-icons but the icons look quite ugly
    a
    p
    • 3
    • 5
  • v

    Vishal kumar singhvi

    08/04/2025, 11:57 AM
    Hi everyone, I'm currently working on implementing Picture-in-Picture (PiP) functionality for a video player in a Kotlin Multiplatform (KMP) project. Specifically, I'm looking to: • Enable PiP when the user presses the home button • Support automatic PiP activation • Maintain compatibility with iOS/Android through KMP If anyone has experience with this or can recommend any helpful articles, tutorials, or blog posts on implementing PiP in KMP, I would greatly appreciate your suggestions. for IOS I am looking android i have created
    g
    a
    • 3
    • 20
  • c

    Christopher Mederos

    08/05/2025, 5:29 AM
    I'm running into an issue on iOS with Koin & compose-navigation where
    collectAsStateWithLifecycle
    stops getting new values after restoring a view model after navigation. However, collecting without lifecycle does keep updating
    Copy code
    @Composable
    fun MyScreen(viewModel: MyViewModel = koinViewModel()) {
        val scope = rememberCoroutineScope()
        // collectLatest: Does Update
        scope.launch {
            viewModel.uiState.collectLatest { state -> println("collectLatest Id: ${state.id}") }
        }
    
        // collectAsState: Does Update
        val uiState by viewModel.uiState.collectAsState()
        Text("collectAsState Id: ${uiState.id}: ")
    
        // collectAsStateWithLifecycle: Does NOT Update
        val uiStateWithLifecycle by viewModel.uiState.collectAsStateWithLifecycle()
        Text("collectAsStateWithLifecycle Id: ${uiStateWithLifecycle.id}: ")
    }
    Any ideas on where I should go looking for a fix?
    • 1
    • 1
  • j

    Javier RG

    08/06/2025, 2:17 PM
    Hi everyone, have any of you experienced a high delay when throwing an exception using compose multiplatform on iOS target?
    g
    t
    • 3
    • 8
  • t

    tylerwilson

    08/15/2025, 1:43 AM
    Trying to update to Compose 1.9.0 and CMP 1.9.0-beta03, and having an issue building for iOS. It appears to me that the lifecycle-viewmodel-savedstate has not been built for iOS. See here: https://central.sonatype.com/search?q=lifecycle-viewmodel-savedstate most packages have the version of 2.9.2 , but the ios bits are 2.9.0-alpha6. And it will not build on iOS. Building with Kotlin 2.2.10. Thank you.
    same 1
    z
    m
    s
    • 4
    • 7
  • i

    Ismail

    08/15/2025, 6:00 PM
    Hey, so i'm using the swift tabview within my cmp app, at the moment its not showing because i need to give it a fixed height, but how do i use the default tabview height and padding?
    Copy code
    @Composable
    actual fun PlatformBottomNavigation(
        selectedTabIndex: Int,
        onTabSelected: (Int) -> Unit,
        navigateToSettings: () -> Unit
    ) {
        val factory = LocalNativeViewFactory.current
        UIKitViewController(
            factory = {
                factory.createBottomNavigation(
                    selectedTabIndex = selectedTabIndex,
                    onTabSelected = onTabSelected,
                    navigateToSettings = navigateToSettings
                )
            },
            modifier = Modifier
                .fillMaxWidth()
        )
    }
    ✅ 1
    • 1
    • 1
  • f

    faogustavo

    08/18/2025, 1:55 PM
    🧵 Autofill support on iOS
    ⬆️ 2
    a
    • 2
    • 5
  • f

    Farhazul Mullick

    08/18/2025, 5:24 PM
    Did anyone faced this error? Tried all this verions. But facing same IrLinkageError.
    Copy code
    # kotlin = "2.1.20" compose = "1.8.2", jbNavigation = "2.8.0-alpha08"
    # kotlin = "2.1.10" compose = "1.8.2" jbNavigation = "2.8.0-alpha08"
    # kotlin = "2.1.10" compose = "1.8.2" jbNavigation = "2.8.0-alpha10"
    Copy code
    Uncaught Kotlin exception: kotlin.native.internal.IrLinkageError: Can not read value from backing field of property 'androidx_compose_animation_core_SeekableTransitionState$stable': Private backing field of property declared in module <org.jetbrains.compose.animation:animation-core> can not be accessed in module <org.jetbrains.androidx.navigation:navigation-compose>
    a
    • 2
    • 4
  • t

    Tristan

    08/19/2025, 11:28 PM
    Hello, using KMP Compose 1.8.2 I am having an issue with text fields. When I tap on a text field I get this error
    Copy code
    Can't show file for stack frame : <DBGLLDBStackFrame: 0x149e1ea90> - stackNumber:0 - name:kfun:kotlin.coroutines.Continuation#<get-context>(){}kotlin.coroutines.CoroutineContext-trampoline. The file path does not exist on the file system: /opt/buildAgent/work/2d153abd4d2c0600/kotlin/libraries/stdlib/src/kotlin/coroutines/Continuation.kt
    And the text field I am using
    Copy code
    var textFieldValue by remember {
        mutableStateOf("")
    }
                    
    OutlinedTextField(
        value = textFieldValue,
        onValueChange = { textFieldValue = it },
        singleLine = true,
        modifier = Modifier.width(160.dp)
    )
    And my imports
    Copy code
    implementation(compose.runtime)
                implementation(compose.foundation)
                implementation(compose.material3)
                implementation(compose.ui)
                implementation(compose.components.resources)
                implementation(compose.components.uiToolingPreview)
    Do you think I am missing something? Other UI elements work fine (buttons and checkboxes)
    a
    d
    • 3
    • 8
  • d

    DevOpsCraftsman

    08/21/2025, 12:55 AM
    Hello everyone. In my team, we are having a big problem with
    TextField
    (and related) on iOS, it always crashes when we trying to click in it... The sample code:
    Copy code
    @Composable
    @Preview
    fun App() {
        TextField(value = "Type", onValueChange = {})
    }
    The srceenshot of the app in the simulator and the crash We tested with compose 1.8.2, 1.8.1, and 1.8.0. For iOS: 18 and 17. EDIT: we are using the 2.9.1 version of the life cycle view mode compose lib, so the proposed fix proposed in thread of the post above doesn't work... The crash error message:
    Copy code
    Can't show file for stack frame : <DBGLLDBStackFrame: 0x12c607040> - stackNumber:0 - name:kfun:kotlin.coroutines.Continuation#<get-context>(){}kotlin.coroutines.CoroutineContext-trampoline. The file path does not exist on the file system: /opt/buildAgent/work/2d153abd4d2c0600/kotlin/libraries/stdlib/src/kotlin/coroutines/Continuation.ktCan't show file for stack frame : <DBGLLDBStackFrame: 0x11c60ab40> - stackNumber:1 - name:kfun:kotlin.coroutines.native.internal.ContinuationImpl#<init>(kotlin.coroutines.Continuation<kotlin.Any?>?){}. The file path does not exist on the file system: /opt/buildAgent/work/2d153abd4d2c0600/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/coroutines/ContinuationImpl.ktCan't show file for stack frame : <DBGLLDBStackFrame: 0x11c60ab40> - stackNumber:1 - name:kfun:kotlin.coroutines.native.internal.ContinuationImpl#<init>(kotlin.coroutines.Continuation<kotlin.Any?>?){}. The file path does not exist on the file system: /opt/buildAgent/work/2d153abd4d2c0600/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/coroutines/ContinuationImpl.kt
    c
    s
    +3
    • 6
    • 8
  • c

    Calle Höglund

    08/21/2025, 9:34 AM
    Hello everybody! Currently testing around in a CMP project. Im having trouble updating the state inside a swiftUI view.
    Copy code
    @Composable
    actual fun NativeButton(
        enabled: Boolean,
        onClick: () -> Unit,
        modifier: Modifier
    ) {
        val factory: NativeViewFactory = LocalNativeViewFactory.current
    
        UIKitViewController(
            modifier = modifier,
            factory = {
                factory.createNativeButton(
                    enabled = enabled,
                    onClick = onClick,
                )
            }
        )
    }
    Changing the enabled flag is not updating the UI in SwiftUI. How do i achieve this? Any suggestions? Thanks! 🙏
    r
    • 2
    • 4
  • a

    Alexis

    08/24/2025, 5:09 PM
    Hello, anyone tried to implement Google AdMob native app in ios using Compose Multiplatform? I've figured out how to load an ad's data, but it seem that I need a native view to handle user's click and that I can't simply use a Compose button's onClick callback. I suppose that I should go for a SwiftUI implementation, but before doing so I wanted to know if anyone had success implementing it in Compose 🙂 Thanks for reading and I wish you all a nice day!
    u
    • 2
    • 2
  • s

    Sam

    08/26/2025, 1:33 PM
    Has anyone got previews working on a project with an iOS target in
    commonMain
    ? I keep getting this:
    Copy code
    No matching variant of org.jetbrains.compose.ui:ui-tooling-preview:1.9.0-beta03 was found. The consumer was configured to find a library for use during 'kotlin-metadata', preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64',
    a
    i
    • 3
    • 4
  • a

    Alexis

    08/27/2025, 2:44 PM
    Hello everyone! I'm starting a new KMP, and I was wandering if for modular architecture, the use of an "umbrella" KMP module was still the recommended way to expose the share code to ios, or if things had change and we can now export our KMP modules as independant XCFramework?
    ✅ 1
    p
    j
    • 3
    • 7
  • m

    markturnip

    08/28/2025, 8:34 AM
    Compose navigation is really what lets iOS down when building a CMP app. I’m wondering whether I build out my navigation/coordinator flow natively by simply embedding each
    ComposeUIViewController
    in the
    UINavigationController
    However it seems @Kashismails has put together a working demo using Voyager. I wonder if anyone else is using a setup like this and in production? https://www.droidcon.com/2024/09/06/using-native-ios-navigation-from-compose-multiplatform/
    j
    • 2
    • 12
  • a

    aidanvii

    08/28/2025, 1:48 PM
    After upgrading from Meerkat to Narwhal, we've noticed a change in how iOS run configurations are done. We are working in a monorepo with 3 apps, 2 of which are compose multiplatform. Even after setting the working directory to the app we actually want to run, it will always run the other. Obfuscated the names in the screenshot, but for example it would run app-1 instead:
    • 1
    • 1