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

    Stan

    06/04/2025, 9:31 PM
    Hi! I am embedding ComposeUIViewController with scaffold that fills max size into iOS app navigation controller with native bottom navigation. But whenever I hide bottom navigation bar compose layout is not getting resized and I see empty space of missing bottom navbar. Is it known issue? Compose v1.8.1
  • m

    Mario Andhika

    06/05/2025, 9:01 AM
    How to implement UIApplicationDelegate from the Kotlin side?
    k
    • 2
    • 1
  • s

    spierce7

    06/05/2025, 1:28 PM
    I saw on the Kotlin youtube channel yesterday that McDonalds have moved over to Kotlin Multiplatform. It actually makes me sad because I opened the McDonalds iOS app last week on my iPhone 16 Pro, and I was just thinking about how terrible the experience has gotten compared to 6-12 months ago on iOS. It's VERY laggy every time a screen is reloaded. Especially while scrolling content. It's not a little worse, it's way worse. Massive jank, where they miss 10+ frames is easily repeatable just by moving between screens and scrolling. I'm sure they are doing things that can improve performance, but this is not a glowing endorsement for KMP.
    d
    j
    +4
    • 7
    • 12
  • j

    Jeff Lockhart

    06/06/2025, 2:34 AM
    I'm finding that `TextField`s on iOS are often inserting spaces between characters when tapping within the text field or long-press moving the cursor. The
    onValueChange
    lambda is being called with the additional space added after tapping/dragging. The space is added where the cursor is before the tap/drag cursor move. It seems to limit the change to one space between each character. Tapping around eventually results in a space between each character. E.g. typing t-e-s-t and tapping/dragging around:
    Copy code
    t
    te
    tes
    test
    te st
    t e st
    t e s t
    Any idea what's going on here? It's the same behavior on Jetbrains Compose plugin 1.6.10-1.8.1 and Kotlin 2.0.21-2.1.21.
    • 1
    • 3
  • c

    curioustechizen

    06/09/2025, 7:26 AM
    I have a problem at the intersection of CMP for iOS, Xcode previews and preview locales. I have a Composable implemented in CMP. I have set it up such that I can correctly preview it in Xcode (using a combination of
    ComposeUIViewController
    and
    UIViewControllerRepresentable
    )
    Copy code
    MyComposable(state: somePreviewState)
    My problem is that when I try to preview this in multiple locales, the locale information seems to get lost somewhere in between the Xcode preview and my Composable.
    Copy code
    MyComposable(state: somePreviewState)
        .environment(\.locale, .init(identifier: "nl"))
    This still shows the English preview. Anyone has run into this? Any ideas on how to get a Composable implemented in iosMain to recognize the locale passed in from an Xcode preview?
    • 1
    • 2
  • m

    Max

    06/09/2025, 10:23 PM
    After watching the WWDC Keynote today, my biggest question is: how do we get Liquid Glas effect in Compose Multiplatform iOS? 😅 My first guess is to get such buttons, a mix of: • Haze for the buttons background • A custom border modifier for a border line consisting of a gradient based on the background But how do we get the 3d effect on the button‘s edges? Anyone has better ideas?
    h
    s
    +3
    • 6
    • 11
  • m

    mohamed rejeb

    06/10/2025, 9:34 PM
    iOS native tab bar with liquid glass effect on a Compose Multiplatform app, no Swift code needed just Compose and Kotlin. Adaptive bottom bar will be added to Calf library soon as well as other liquid glass components kodee loading
    Screen Recording 2025-06-10 at 5.54.49 PM.mov
    kodee happy 14
    kodee loving 10
    🤩 4
    K 19
    🔥 13
    cmp 42
    m
    l
    • 3
    • 2
  • b

    Binish Mathew

    06/11/2025, 1:51 PM
    Hi guys, I am using Kotlin 2.2.0-RC2 and compose multiplatform 1.8.1. I use coil 3.2.0 to show an image in the composable.
    Copy code
    @Composable
    fun Feck() {
        AsyncImage(
            modifier = Modifier
                .size(96.dp)
                .clickable {
    
                },
            onLoading = { successState ->
                println("Image loading...")
            },
            onSuccess = { successState ->
                println("Image loaded successfully!")
            },
            onError = { errorState ->
                println("Image loading failed: ${errorState.result.throwable.message}")
            },
            model = Res.getUri("drawable/settings_icon_filled.svg"),
            colorFilter = ColorFilter.tint(color = Color.Red),
            contentDescription = null
        )
    }
    This code works on my sample Android app and iOS app within the kmp project. I wanted to use the module in another existing ios app. So, I have exported an XCFramework with resources and verified that the resources are bundled.
    Copy code
    fun FeckUIViewController() = ComposeUIViewController {
        Feck()
    }
    Copy code
    import UIKit
    import SwiftUI
    import Foundation
    import common
    import chatui
    
    struct ComposeView: UIViewControllerRepresentable {
        func makeUIViewController(context: Context) -> UIViewController {
            
            let fileManager = FileManager.default
    
                    print("--- Listing Main Bundle Contents ---")
                    // Corrected line: Access bundlePath directly as it's a String, not an Optional
                    let bundlePath = Bundle.main.bundlePath
                    print("Main Bundle Path: \(bundlePath)")
                    do {
                        let bundleContents = try fileManager.contentsOfDirectory(atPath: bundlePath)
                        print("Contents of Main Bundle:")
                        for item in bundleContents {
                            print("- \(item)")
                        }
                    } catch {
                        print("Error listing main bundle contents: \(error.localizedDescription)")
                    }
    
                    print("\n--- Checking for compose-resources directly in main bundle ---")
                    if let composeResourcesURL = Bundle.main.url(forResource: "compose-resources", withExtension: nil) {
                        print("Found compose-resources directory at URL: \(composeResourcesURL.path)")
                        // Optionally, list contents of compose-resources if found
                        do {
                            let resourcesContents = try fileManager.contentsOfDirectory(atPath: composeResourcesURL.path)
                            print("Contents of compose-resources:")
                            for item in resourcesContents {
                                print("- \(item)")
                            }
                        } catch {
                            print("Error listing compose-resources contents: \(error.localizedDescription)")
                        }
    
                    } else {
                        print("compose-resources directory NOT found in main bundle.")
                    }
    
                    print("\n--- Checking for composeResources directly in main bundle (alternative casing) ---")
                    if let composeResourcesURL = Bundle.main.url(forResource: "composeResources", withExtension: nil) {
                        print("Found composeResources directory at URL: \(composeResourcesURL.path)")
                    } else {
                        print("composeResources directory NOT found in main bundle.")
                    }
    
            
            return FeckViewControllerKt.FeckUIViewController()
        }
    
        func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
    }
    
    struct ContentView: View {
        var body: some View {
            ComposeView()
                    .ignoresSafeArea(.keyboard)
        }
    }
    But coil fails to find the resource file. --- Listing Main Bundle Contents --- Main Bundle Path: /Users/binishmathew/Library/Developer/CoreSimulator/Devices/AB7ABA72-71AC-4578-89E9-79B6A72AB285/data/Containers/Bundle/Application/4C921F2E-698A-4B4F-A07B-03064D8BD661/ios.app Contents of Main Bundle: - _CodeSignature - ios.debug.dylib - __preview.dylib - ios - Frameworks - Info.plist - PkgInfo --- Checking for compose-resources directly in main bundle --- compose-resources directory NOT found in main bundle. --- Checking for composeResources directly in main bundle (alternative casing) --- composeResources directory NOT found in main bundle. Image loading... Image loading failed: No such file or directory Is there any way to fix this ?
    🧵 7
    k
    s
    • 3
    • 15
  • s

    Sargun Vohra

    06/13/2025, 2:10 AM
    Curious, as I haven't been using Compose Multiplatform long enough to know the typical release patterns: do Kotlin and Compose typically update to support the latest beta iOS and XCode, or do they tend to wait for official release? I only have one Mac and iPhone but decided to go for the developer beta anyway just to try things out, and can get by fine developing against XCode 16.4 and its simulator, but won't be able to test on my real phone (running the iOS beta) until Kotlin + Compose works with XCode 26
    f
    • 2
    • 6
  • k

    krzysztof

    06/13/2025, 7:16 AM
    do animations work in compose multiplatform preview?
    p
    • 2
    • 1
  • m

    Mario Andhika

    06/14/2025, 4:00 AM
    Anyone ever got EXC_BAD_ACCESS (SIGSEGV) KERNEL_PROTECTION_FAILURE using DataStore Preferences? Also load_eligibility_plist: Failed to open some_path/eligibility.plist: No such file or directory(2)
  • r

    Rafs

    06/14/2025, 7:06 AM
    Is anybody else having this issue on iOS after the latest compose update? It's failing to resolve some symbols for saved state library
    m
    • 2
    • 1
  • m

    Mario Andhika

    06/16/2025, 3:59 AM
    How to detect which build targets are needed in gradle? For example I want to exclude iosArm64() when deploying to simulator.
    f
    • 2
    • 2
  • j

    Jimmy Nelle

    06/16/2025, 1:05 PM
    Copy code
    val windowInfo = LocalWindowInfo.current
        val isInRecentApps by rememberUpdatedState(!windowInfo.isWindowFocused)
    
        LaunchedEffect(isInRecentApps, signInState) {
            println("isInRecentApps: $isInRecentApps")
        }
    I'm currently experiencing issues with LocalWindowInfo on iOS. It doesn't seem to detect when the app is not focused (i.e., when switching to recent apps or multitasking). I'm using
    CMP 1.8.1
    on
    iOS 18.4 and 26 Beta
    Is anyone else encountering this problem?
    a
    • 2
    • 2
  • i

    Isaac Udy

    06/17/2025, 8:54 PM
    How do I create a run configuration for an iOS application with the new KMP plugin for Intellij? Using the older plugin a month or two ago, it was pretty easy, but the new plugin doesn't work with the same run configurations, and I can't seem to get the "XCode Application" run configuration working (the "target" and "configuration" drop-downs don't have anything in them; screenshot in thread)
    x
    • 2
    • 9
  • i

    Isaac Udy

    06/18/2025, 10:31 AM
    Is there anyone from the Compose Mutliplatform team that might be able to shed light on why ComposeHostingViewController does not implement LifecycleOwner/ViewModelStoreOwner, and hides the IOSLifecycleOwner property? I'm working on some things that deal with interop between Compose and iOS applications, and it would make my life significantly easier if I was able access the IOSLifecycleOwner property, or if the ComposeHostingViewController implemented LifecycleOwner/ViewModelStoreOwner.
    j
    a
    • 3
    • 5
  • i

    Isaac Udy

    06/18/2025, 11:08 PM
    I have a ComposeUIViewController which, under some circumstances, may end up hosting another ComposeUIViewController inside of a UIKitViewController within the composition. I would have expected that Composition Locals set within the parent/root ComposeUIViewController to be available within the child ComposeUIViewController's composition, but it doesn't appear that this is the case. Is this expected behaviour/are there any plans to propagate Composition Locals in these situations?
    a
    • 2
    • 3
  • k

    Kashismails

    06/19/2025, 10:55 AM
    has anyone tried use Adjust SDK using cocoapod? for some reason cocoapod isnt able to find the pod
    j
    • 2
    • 1
  • s

    Stan

    06/20/2025, 8:02 PM
    Hi! Has anyone implemented iOS native-alike swipe to refresh on KMP?
  • d

    Dumitru Preguza

    06/21/2025, 12:10 PM
    Hi, I get this warning during app start on simulator/device and have no idea how to fix it, I can't see anything wrong with the code 2025-06-21 140257.060306+0200 iosApp[2197:207058] void * _Nullable NSMapGet(NSMapTable * _Nonnull, const void * _Nullable): map table argument is NULL Anyone else had this?
  • a

    Angel Solis

    06/23/2025, 1:37 PM
    Hi 👋 quick question, I would like to setup Rive in my app, I have setup a kmp module called core:rive that has a expect/actual for the Rive component. This core:rive module lives outside the app project like this:
    Copy code
    root/
    ├── core/
    │   └── Rive/
    ├── myApp/
        ├── androidApp/
        ├── shared/
        └── iosApp/
    How can i setup Rive iOS in the core:rive and use it in iosMain? core:rive does not have an iosApp
  • d

    Daniele B

    06/24/2025, 8:44 PM
    There seems to be a configuration bug on CMP projects (Android+iOS+Desktop) created with the KMP wizard: https://kmp.jetbrains.com/?android=true&ios=true&iosui=compose&desktop=true&includeTests=true When I run the iOS app (with a Mac, targeting a physical iPhone) I get this error:
    Error running "iosApp"
    @NotNull method com/intellij/execution/configurations/GeneralCommandLine.getExePath must not return null
    I also get a warning:
    search path '/Users/MYDIR/KotlinProject/shared/build/xcode-frameworks/Debug/iphoneos18.5' not found
    It's looking for that file in the "shared" directory, which doesn't exist. I can see the "/shared/" path is referenced inside the "_/Users/MYDIR/KotlinProject/iosApp/iosApp.xcodeproj/project.pbxproj_" file, in the "FRAMEWORK_SEARCH_PATHS" values. This is the first KMP project I see without the "shared" subproject, having only the "ComposeApp" and "iosApp" subprojects. The KotlinConf app still has a "shared" subproject, despite being a CMP app. In case of a CMP app, not having a "shared" subproject makes sense to me, as all the shared code can go within the "ComposeApp" subproject. So, the project structure sounds right. There must be some bugs in the project configurations.
    • 1
    • 1
  • m

    Max

    06/24/2025, 11:00 PM
    🍎 Embedding SwiftUI view inside Compose I‘m trying to find documentation on how Swift-Compose interop works under the hood. Does anyone have a useful link? Specifically i‘d like to know: • do swift interop views live on top of the Compose skia canvas, or the canvas has a cutout where it‘s transparent and the swift view is below • what performance tradeoffs are to be expected and why • can the swift ui view exceeds it‘s bounds? (e.g. with the new liquid glass design, it looks to me like a view grows when touched and the liquid effect starts)
    ✅ 1
    ➕ 2
    a
    • 2
    • 2
  • j

    Jimmy Nelle

    06/25/2025, 7:42 AM
    Hi, After updating to the latest macos beta, I'm getting the following error on my CMP project when I try to run the iOS App. Anyone having an idea how to fix this?
    Copy code
    Exception in thread "main" java.lang.Error: /Applications/Xcode-26.0.0-Beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitDefines.h:10:9: fatal error: 'UIUtilities/UIDefines.h' file not found
    /Users/jimbo/dev/myproject/core/build/spmKmpPlugin/coreNativeIosShared/scratch/checkouts/GoogleSignIn-iOS/GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h:21:9: fatal error: could not build module 'UIKit'
    /Users/jimbo/dev/myproject/core/build/spmKmpPlugin/coreNativeIosShared/scratch/checkouts/gtm-session-fetcher/Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h:265:9: fatal error: could not build module 'UIKit'
    	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:80)
    	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:15)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:567)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:307)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLibSafe(main.kt:243)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.access$processCLibSafe(main.kt:1)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.Interop.interop(main.kt:101)
    	at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:48)
    	at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:23)
    	at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:44)
    z
    c
    • 3
    • 4
  • g

    Giuseppe Joshua Falcone

    06/25/2025, 3:18 PM
    I’m using mokkery as a testing library but when I run it on Android it works but not on iOS. Is this the dafault value or am I not understanding how it works ? If you are wondering what issue I’m getting on iOS I’ll attach a screenshot.
  • c

    Clément Vandendaelen

    06/26/2025, 12:41 PM
    Hello 👋 I have a second compose multiplatform app in the project, how can I debug it using Android Studio with the latest plugin (Kotlin Multiplatform) ? There, I can only select the target for the first compose-app (I tried to change the working directory, but no luck)
  • l

    logosdeborah

    06/27/2025, 12:31 PM
    Hi, anyone experiencing the text is not centered on iOS if the letterspacing is added?
    Copy code
    Text(
        modifier = Modifier
            .background(Color.Yellow)
            .padding(8.dp),
        text = "1234",
        letterSpacing = 16.sp,
        fontSize =  20.sp,
    )
    The first image is iOS and the second one is Android.
    🤔 1
    j
    • 2
    • 3
  • d

    dhia chemingui

    06/30/2025, 10:54 AM
    Hi I want to add annotating string or html text to the clipboard in compose . I want to use LocalClipboard But in the old deprecated api it works. what I should do since clipEntry in ios take only text
  • f

    Fedor Sorokin

    06/30/2025, 12:05 PM
    On iOS material2 DropdownMenu and ExposedDropdownMenu, when column is big enough, is show behind keyboard and over active text field (positioned inside of ExposedDropdownMenuBox) On Android same code runs perfectly, rendering menu not clipping behind keyboard and rendering strictly around text field Is this known bug or should i create new ticket?
  • n

    neworldlt

    07/01/2025, 1:18 PM
    Hello, first steps with KMM for iOS and found weird issue I don't get. After adding more compose stuff, compose rendering is delayed and I see warning:
    Gesture: System gesture gate timed out
    . I can not understand what I added which caused gesture problems?
    j
    • 2
    • 3