Hi everyone, I’m working on a Compose Multiplatfor...
# compose-ios
n
Hi everyone, I’m working on a Compose Multiplatform app using Navigation3 on iOS. In my app, the user can choose the language at runtime. When an RTL language is selected, I inject
LocalLayoutDirection
above my
NavDisplay
, for example:
Copy code
CompositionLocalProvider(
    LocalLayoutDirection provides if (isRtl) LayoutDirection.Rtl else LayoutDirection.Ltr
) {
    NavDisplay(...)
}
This works for most of the Compose UI. However, on iOS, the interactive back gesture still starts from the left edge, even when the app is in RTL. What I would expect in RTL is the opposite of LTR: the back gesture should start from the right edge. So my questions are: 1. Is there a supported way to make the iOS back gesture respect a runtime RTL language selected inside the app, rather than the system/UIWindow layout direction? 2. Is there a Navigation3-level configuration to control the back gesture edge on iOS? 3. Also, why do the default Navigation3 transition specs use:
AnimatedContentTransitionScope.SlideDirection.Left / Right
instead of:
AnimatedContentTransitionScope.SlideDirection.Start / End
? Using
Start / End
would seem more natural for RTL-aware navigation transitions, and this would be handled standardly instead of providing custom transitions on iOS. Thanks!
u
n
The resources localization are already successfully reloaded. The only pain point is the back/transition management 😞
I found a way by applying the layout direction at the root of the SwiftUI application
Copy code
ContentView()
        .id(isRtl)
        .environment(\.layoutDirection, isRtl ? .rightToLeft : .leftToRight)