Skip to content

iOS 16/17 .destination not working after view is hidden/shown (menu) but it works on iOS 18 #3496

Closed
@jerometonnelier

Description

@jerometonnelier

Description

Hi everyone,

weird bug here.
I've got a SwiftUI view that represents a Menu (embed inside a UIViewController since the rest of the project is UIKit based) and used along with SideMenu.
I used one of the latest TCA implementation with @Perception.Bindable var store: StoreOf, @Reducer reducers, @ObservableState states, @presents and CasePath macros to push some views onto a NavigationStack.

With iOS 18, everything works fine, I can push some views on the SwiftUI Stack, show the UIKit Rootview of the UIKit core part.
But with iOS17, I get this issue : when I first launch the app, everything works fine the first time I show the menu. I can navigate inside, no worries. But if I close the menu and open it again, no more view is pushed onto the stack (or dismissed for that matter. The action is triggered, the @presents variable is filled, but I never enter the .destination modifier.

Here is the one of the modifiers

.navigationDestination(
                                    store: self.store.scope(
                                        state: \.$taximeterSubMenu,
                                        action: \.taximeterSubMenuAction)) { subStore in
                                            WithPerceptionTracking {
                                                TaximeterMenuView(store: subStore)
                                                    .onAppear { handleNavBar() }
                                            }
                                        }

the Case Path macro

static let taximeterSubMenuCasePath = AnyCasePath<Action, PresentationAction<TaximeterMenuFeature.Action>> (
            embed: { .taximeterSubMenuAction($0) },
            extract: { if case let .taximeterSubMenuAction(value) = $0 { return value } else { return nil } }
        )

Is there some breakpoint I can make or logs to activate to try to see what happens ?
I'll check with the company if it's possible to send the source code, that would be easier.

Thanks

Checklist

  • I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue or discussion.

Expected behavior

No response

Actual behavior

No response

Reproducing project

No response

The Composable Architecture version information

1.15.2

Destination operating system

iOS 17

Xcode version information

Xcode 16.2

Swift Compiler version information

swift-driver version: 1.115 Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
Target: arm64-apple-macosx15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions