https://kotlinlang.org logo
Join SlackCommunities
Powered by
# compose-ios
  • y

    Yuvaraj

    03/27/2025, 3:41 AM
    #C0346LWVBJ4 How can we access the AVPlayer FullScreen close button?
  • y

    Yuvaraj

    03/27/2025, 3:57 AM
    Copy code
    ComposeUIViewControllerDelegate viewDidDisappear and viewWillDisappear is never called
    as per the doc it should work but it is not working https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-lifecycle.html#mapping-android-lifecycle-to-other-platforms
  • f

    Fudge

    03/30/2025, 9:08 PM
    Hey guys, I would really appreciate if I could get your experience regarding performance while running Compose apps on iOS (jank is lag spikes /fps drops for those not familiar with the term) (Running in Release) 🔥 I've had no jank or fps issues 👀 There is some initial jank but after that it runs smoothly 🥶 Jank occurs occasionally 💤 I often find it difficult to reach the target frame rate of the device
    👀 5
    🥶 4
    💤 2
    🔥 10
    f
    d
    +3
    • 6
    • 11
  • j

    Jonathan

    03/31/2025, 10:20 PM
    Is it possible to import & reference dependencies added via SPM in
    shared/src/iOSMain/kotlin
    ? I would like to add the UIKit view but I’m the JetBrains documentation only shows an example importing from platform package such as
    platform.MapKit.MKMapView
    or
    platform.UIKit.UITextField
    . I found an example importing a third-party library using Cocoapods but I wasn’t sure if this is a requirement of Compose Multiplatform or just a preference of the examples developer.
    a
    • 2
    • 4
  • a

    Aleksey Zamulla

    04/04/2025, 9:16 AM
    Reposting here to hear from iOS folks, as discrepancies between Android and iOS are the bulk of reported problems: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1743758125868409
  • s

    sweetclimusic

    04/04/2025, 9:31 AM
    does anyone have a reference to the rules the CMP applies when converting semantic contentDescription to accessibility labels? Seen a instance where on iOS the content description removes the Text of a button and sets the contentDescription as the Buttons Label. I’d guess for my case I would want a way to send the accessibilityChild options from compose to swift so I can ignore this contentDescription for one particular item without goint down the expect actual root. Thanks.
    a
    • 2
    • 8
  • r

    Rok Oblak

    04/04/2025, 9:04 PM
    I lost track but is there already a ticket for janky keyboard opening behavior? Especially when it pushes the content upwards. See video.
    ScreenRecording_04-05-2025 04-03-03_1.MP4
  • k

    krzysztof

    04/07/2025, 9:43 AM
    Is there a way to create a bitmap, that can be used to create ImageBitmap for compose? I have encoded barcode into intarray and want to create the image of it. It is fine on android, because I have mutable bitmap available, so I wonder if there's anything like this for iOS
    a
    • 2
    • 4
  • m

    Mate Ajdukovic

    04/09/2025, 11:30 AM
    Hey all 👋 We are working on E2E tests using Appium for a KMP app (Android/iOS) with Jetpack Compose UI. On Android, everything works fine — We can locate elements using
    testTag
    . But on iOS, Appium Inspector just shows a bunch of nested
    XCUIElementTypeOther
    elements — nothing is accessible via
    accessibilityId
    , XPATH, etc. We tried adding
    Modifier.semantics { contentDescription = "..." }
    alongside
    testTag
    , built the Compose framework with
    ./gradlew linkDebugFrameworkIosSimulatorArm64
    , added it to Xcode (Embed & Sign), cleaned DerivedData, and rebuilt the app. Still, the elements aren’t exposed in Appium or Xcode Accessibility Inspector. Anyone got Compose-based elements discoverable on iOS for Appium? Are we missing something? Does anyone have an example of the repository where accessbility ID for iOS can be viewed using Appium Inspector? Attached screenshot of how the PoC app looks like in Appium Inspector for Android and iOS app.
    👀 2
    a
    j
    • 3
    • 6
  • x

    xiaobailong24

    04/14/2025, 3:05 PM
    Hello, will Compose for iOS go stable in Kotlin Conf 2025?👀 K
    kodee happy 8
    🙏 12
    K 23
    awkward monkey 19
    🙏🏿 1
  • u

    אליהו הדס

    04/21/2025, 1:37 PM
    I'm using IntelliJ Ultimate, and to run my Compose app on iOS, I have to open Xcode and run it. Is there another way?
    z
    j
    c
    • 4
    • 7
  • m

    Mubarack Tahir

    04/23/2025, 5:16 PM
    Hello Team I don't know if this is the right place to ask this. I have a string that is server driven, this string is an HTML text that has most of the html tags like, b/b,u/u,font color=#000000/font. How do I render this text using AnnotatedString ? I have tried this, but it only works for android, it doesn't work for iOS.
    Copy code
    @Composable
    fun annotatedString(text: String): AnnotatedString {
        return runCatching {
            AnnotatedString.fromHtml(text)
        }.getOrDefault(AnnotatedString(text))
    }
    here is an example of the string "font color='#DDDDDD'bCat/b/font and mouse are bfriends/b who loves uKotlin/u"
    a
    • 2
    • 1
  • o

    Ori Spokoini

    04/24/2025, 8:43 AM
    rebooting the device seems to temporarily fix it.
  • j

    John O'Reilly

    04/25/2025, 8:53 AM
    Pulling in CMP 1.8.0-rc01 and getting following when building iOS client. Anyone know what cause might be?
    Copy code
    Undefined symbol: _kfun:androidx.compose.animation.core#androidx_compose_animation_core_MutableTransitionState$stableprop_getter$artificial(){}<http://kotlin.Int|kotlin.Int>
    
    Undefined symbol: _kfun:androidx.compose.animation.core#androidx_compose_animation_core_TransitionState$stableprop_getter$artificial(){}<http://kotlin.Int|kotlin.Int>
    
    Undefined symbol: _kfun:androidx.compose.ui.graphics.vector#androidx_compose_ui_graphics_vector_VectorPainter$stableprop_getter$artificial(){}<http://kotlin.Int|kotlin.Int>
    e
    r
    +3
    • 6
    • 22
  • r

    Roland Ringgenberg

    04/27/2025, 2:54 PM
    Hi everyone, I'm having a hard time to validate an email in a KMP/CMP project in the iOS target (Kotlin: 2.1.20 Compose: 1.8.0-rc01). I have different ways how to solve it for the other platforms (android, desktop, wasmJs), but I didn't found a way to make it work on iOS. At the moment I'm back to just Regex, but not even this simple code works, let alone everything the AI suggests using iOS classes from the foundation package, lol. When I just return 'true' everything works as expected. Any clue what I'm doing wrong or what could work?
    Copy code
    private fun emailAddressRegex(value: String): Boolean {
        val emailRegex = Regex(
            // Very basic regex, without checking for edge case or i18n etc
            "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"
        )
        return value.matches(emailRegex)
    }
    I'm calling it from a BasicTextField using
    Copy code
    snapshotFlow()
    to update the state. Btw, the fix of the BasicSecureTextField works like a charm, thx!
    • 1
    • 1
  • a

    Armond Avanes

    04/28/2025, 1:06 AM
    Does anyone know if
    enableTraceOSLog()
    API (to enable iOS logging) can be called in any build type or it's intended to be used only in dev/debug/non-production builds?
    a
    • 2
    • 1
  • j

    Jonathan

    04/28/2025, 11:32 PM
    Does anyone one know why some platform APIs are available under iosMain/ such as
    platform.CoreLocation.CLLocation
    but not APIs like
    platform.*.NWPathMonitor
    ?
    m
    • 2
    • 2
  • s

    sweetclimusic

    04/30/2025, 9:39 AM
    Hello, I’m working on. CMP with a iOS target Kotlin: 2.1.20, Compose: 1.8.0-rc01. I’m trying to include a swiftui component within the compose view, I’m following this medium article for implementation. https://cazimirroman.medium.com/mixing-swiftui-and-jetpack-compose-in-a-kotlin-multiplatform-project-for-ios-2f49a47085e7 now this works with these versioning. (see screenshot) what i currently get is a error when I try to view the screen with my native swiftUI controller.
    Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<_TtGC7SwiftUI19UIHostingControllerV12SharedApp13TextInputView_: 0x1008a0a00> should have parent view controller:(null) but actual parent is:<ComposeHostingViewController: 0x10122f860>'
    So if this is the error, is it a case that I just need an empty UIViewController and add the newly hostedViewController to that? The other hidden context is that this is a bottomsheet
    👀 1
    ✅ 1
    • 1
    • 3
  • j

    juhaodong

    05/03/2025, 5:26 PM
    this steps take at least 5 min
  • j

    juhaodong

    05/03/2025, 5:26 PM
    is there any way to speed it up? or are there some new config need to be set?
    🧵 1
    z
    f
    a
    • 4
    • 5
  • m

    Max

    05/05/2025, 11:51 AM
    I’m seeing in production some crashes for `invalidatePositionInWindow`: Does anybody know what the root cause for that is? Phone: iPhone SE
    i
    a
    • 3
    • 4
  • m

    Marcel

    05/06/2025, 11:31 AM
    Hi there, I'm getting this animation flickering when expanding a CMP view inside a SwiftUI scroll view that looks like this:
    Copy code
    ScrollView {
        VStack {
            cmpView1
    
            cmpView2
    
            swiftView1
    
            swiftView2
    
            // ...
        }
    }
    I'm using Compose 1.8.0-rc01, and this is how I'm creating the animation:
    Copy code
    AnimatedVisibility(
        modifier = Modifier.fillMaxWidth(),
        visible = state.isVisible,
        enter = fadeIn(animationSpec = tween(durationMillis = 500)) + expandVertically(
            expandFrom = <http://Alignment.Top|Alignment.Top>,
            animationSpec = tween(durationMillis = 500)
        ),
        exit = fadeOut(animationSpec = tween(durationMillis = 500)) + shrinkVertically(
            shrinkTowards = <http://Alignment.Top|Alignment.Top>,
            animationSpec = tween(durationMillis = 500)
        )
    ) {
        // Banner
    }
    Any possible solutions to make it look nicer?
    ScreenRecording_05-06-2025 13-26-20_1.MP4
    c
    j
    c
    • 4
    • 15
  • x

    xiaobailong24

    05/06/2025, 11:10 PM
    K Compose Multiplatform 1.8.0: Now Stable and Production-Ready on iOS! K Build mobile apps faster with shared UI code, full control over native experiences, and the confidence to ship at scale. Compose Multiplatform for iOS is now production-ready and fully equipped with everything you need to craft beautiful UIs for real-world apps. 🔥🔥🔥 Check out the latest updates in Compose Multiplatform 1.8.0 and see why it's the perfect time to start using it. 🚀 Slack Conversation
    K 9
    kodee happy 8
    💯 5
    🎉 5
    kodee loving 4
    K 17
    c
    • 2
    • 1
  • u

    ursus

    05/07/2025, 2:54 AM
    Am I reading this graph right? CMP outputs more fps than swiftui (i.e. better perf)…?
    😅 5
    🚀 4
    c
    n
    r
    • 4
    • 8
  • h

    Heehoon Jeon

    05/07/2025, 5:27 AM
    Hi there, I have a question regarding iOS during CMP development. The CMP version I'm using is
    1.8.0
    , and for multiplatform-navigation, it's
    2.9.0-beta01
    . The problem is that when using
    androidx.compose.ui.window.Dialog
    in
    commonMain
    , the dialog no longer appears after using features like an
    in-app browser
    or the
    native camera
    . Is there a way to solve this? this code working in cmp
    1.7.3
    , navigation
    2.8.0-alpha10
    Below is the test code:
    Copy code
    NavHost(
        navController = navController,
        startDestination = startDestination,
    ) {
        composable(route = "home") {
            Home()
        }
    }
    
    @Composable
    private fun Home() {
        var openDialog by remember { mutableStateOf(false) }
    
        Column(
            modifier = Modifier
                .systemBarsPadding()
                .fillMaxWidth(),
            horizontalAlignment = Alignment.CenterHorizontally
        ) {
            Text("Home")
    
            Button(
                onClick = { openDialog = true }
            ) {
                Text("Open Dialog")
            }
    
            Button(
                onClick = { PlatformInAppBrowserController.launch("<https://blog.jetbrains.com/kotlin/2025/05/compose-multiplatform-1-8-0-released-compose-multiplatform-for-ios-is-stable-and-production-ready/>") }
            ) {
                Text("Open inAppBrowser")
            }
        }
    
        if (openDialog) {
            Dialog(
                onDismissRequest = { openDialog = false },
                properties = DialogProperties(
                    dismissOnBackPress = true,
                    dismissOnClickOutside = true,
                    usePlatformDefaultWidth = true
                )
            ) {
                Box(
                    modifier = Modifier.fillMaxWidth()
                        .background(Color(0xFFFFFFFF))
                        .padding(40.dp)
                ) {
                    Text(
                        text = "Home Dialog"
                    )
                }
            }
        }
    }
    PlatformInAppBrowserController.ios.kt
    :
    Copy code
    actual object PlatformInAppBrowserController {
    
        private var lastPresentViewController: SFSafariViewController? = null
    
        private val rootViewController: UIViewController?
            get() = UIApplication.sharedApplication.keyWindow?.rootViewController
    
        actual fun launch(url: String) {
            val rootViewController = rootViewController ?: return
            val viewController = NSURL.URLWithString(url)?.let { nsUrl -> SFSafariViewController(nsUrl) } ?: return
            viewController.modalPresentationStyle = UIModalPresentationFullScreen
            lastPresentViewController = viewController
    
            rootViewController.presentViewController(
                viewControllerToPresent = viewController,
                animated = true,
                completion = {},
            )
        }
    }
    i
    • 2
    • 3
  • j

    Joel Denke

    05/07/2025, 6:01 AM
    Now when iOS stable, is it now possible import Swift libraries like Apple Crypto? Or in general combine libraries directly between Kotlin, Swift and ObjC. Thats my main issue at the moment. Also stuff like Firebase.
    i
    f
    j
    • 4
    • 8
  • s

    Shivam Dhuria

    05/07/2025, 9:08 AM
    Hey guys, I am trying to use a SwiftView on top of my Composable Screen, a SwiftUI Text() using
    UIKitViewController
    . However, it always seems to add a White background to it. I understand there’s a active issue for it but is there a workaround for it?
    i
    d
    • 3
    • 5
  • s

    Sargun Vohra

    05/10/2025, 6:16 AM
    After updating to Compose 1.8.0, I'm seeing some Klib Resolver issues on `compileIosMainKotlinMetadata`:
    Copy code
    w: KLIB resolver: The same 'unique_name=annotation_commonMain' found in more than one library: /Users/runner/work/maplibre-compose/maplibre-compose/lib/maplibre-compose/build/kotlinTransformedMetadataLibraries/commonMain/androidx.annotation-annotation-1.9.1-commonMain-WmoUwA.klib, /Users/runner/work/maplibre-compose/maplibre-compose/lib/maplibre-compose/build/kotlinTransformedMetadataLibraries/commonMain/org.jetbrains.compose.annotation-internal-annotation-1.8.0-commonMain-nX1O7g.klib
    
    w: KLIB resolver: The same 'unique_name=collection_commonMain' found in more than one library: /Users/runner/work/maplibre-compose/maplibre-compose/lib/maplibre-compose/build/kotlinTransformedMetadataLibraries/nativeMain/androidx.collection-collection-1.5.0-commonMain-j7f1lg.klib, /Users/runner/work/maplibre-compose/maplibre-compose/lib/maplibre-compose/build/kotlinTransformedMetadataLibraries/nativeMain/org.jetbrains.compose.collection-internal-collection-1.8.0-commonMain-5vjmwQ.klib
    > Task :lib:maplibre-compose:compileIosMainKotlinMetadata FAILED
    Full CI log here: https://github.com/sargunv/maplibre-compose/actions/runs/14942414618/job/41981406361?pr=317#step:4:466 Looking at the dependency tree, it seems org.jetbrains.compose.collection-internal-collection-1.8.0 depends on androidx.collection-collection-1.5.0, and ditto for the annotation conflict, so sounds like this is likely to be a bug in Compose Multiplatform v1.8.0? Are there any workarounds?
    • 1
    • 1
  • m

    Mohammad Reza Najafi

    05/11/2025, 5:44 AM
    Hi 👋 I am trying to refactor an existing code into CMP, Android seems working fine but iOS is complaining with the following error:
    Copy code
    Showing Recent Messages
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
    
    /Users/StudioProjects/iosApp/ld:1:1: ignoring duplicate libraries: '-ldl', '-lz'
    
    Undefined symbols for architecture arm64:
    
      "_kfun:androidx.compose.runtime#androidx_compose_runtime_ProvidedValue$stableprop_getter$artificial(){}kotlin.Int", referenced from:
    
          _kfun:com.slack.circuit.sharedelements#ProvideAnimatedTransitionScope(com.slack.circuit.sharedelements.SharedElementTransitionScope.AnimatedScope;androidx.compose.animation.AnimatedVisibilityScope;kotlin.Function3<com.slack.circuit.sharedelements.SharedElementTransitionScope?,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int){} in libcircuit-root:circuit-shared-elements-cache.a[2](libcircuit-root:circuit-shared-elements-cache.a.o)
    
          _kfun:com.slack.circuit.foundation#CircuitCompositionLocals(com.slack.circuit.foundation.Circuit;com.slack.circuit.retained.RetainedStateRegistry?;kotlin.Function2<androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){} in libcircuit-root:circuit-foundation-cache.a[2](libcircuit-root:circuit-foundation-cache.a.o)
    
          _kfun:com.slack.circuit.foundation#CircuitContent(com.slack.circuit.runtime.screen.Screen;com.slack.circuit.runtime.Navigator;androidx.compose.ui.Modifier?;com.slack.circuit.foundation.Circuit?;kotlin.Function4<com.slack.circuit.runtime.screen.Screen,androidx.compose.ui.Modifier,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>?;kotlin.Any?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){} in libcircuit-root:circuit-foundation-cache.a[2](libcircuit-root:circuit-foundation-cache.a.o)
    
          _kfun:com.slack.circuit.foundation.RetainedStateHolderImpl.RetainedStateProvider#internal in libcircuit-root:circuit-foundation-cache.a[2](libcircuit-root:circuit-foundation-cache.a.o)
    
          _kfun:com.slack.circuit.foundation.RetainedStateHolderImpl.RetainedStateHolderImpl$RetainedStateProvider$1.invoke#internal in libcircuit-root:circuit-foundation-cache.a[2](libcircuit-root:circuit-foundation-cache.a.o)
    
          _kfun:com.slack.circuit.foundation.SaveableStateHolderImpl.SaveableStateProvider#internal in libcircuit-root:circuit-foundation-cache.a[2](libcircuit-root:circuit-foundation-cache.a.o)
    
    ld: symbol(s) not found for architecture arm64
    z
    • 2
    • 5
  • c

    Colton Idle

    05/12/2025, 8:50 PM
    Has anyone implemented iOS quick actions with a CMP project?
    m
    • 2
    • 1